# in a vector
replace_bad_pixs(c(1, 1, 45, 1, 1), bad.pix.idx = 3)
# before replacement
white_led.raw_spct$counts_3[120:125]
# replacing bad pixels at index positions 123 and 1994
with(white_led.raw_spct,
replace_bad_pixs(counts_3, bad.pix.idx = c(123, 1994)))[120:125]
Run the code above in your browser using DataLab