# create sample data with some missing rows and one entire missing spectra
x <-
ir::ir_sample_data
x$spectra[[1]] <- x$spectra[[1]][0, ]
x$spectra[[2]][1:100, "y"] <- NA_real_
# remove missing values (but remove no rows in x)
x1 <-
x |>
ir::ir_remove_missing(remove_rows = FALSE)
# remove missing values (and remove rows in x if a compete spectrum is
# missing)
x2 <-
x |>
ir::ir_remove_missing(remove_rows = TRUE)
nrow(x)
nrow(x1)
nrow(x2)
Run the code above in your browser using DataLab