View source: R/ir_remove_missing.R
| ir_remove_missing | R Documentation |
irir_remove_missing takes and object of class ir and removes all
rows in the data.frames of the list column spectra that have
NA intensity values (column y). Additionally, one can specify
to remove rows in the ir object to discard if they contain empty
spectra.
ir_remove_missing(x, remove_rows = FALSE)
x |
An object of class |
remove_rows |
A logical value indicating if rows in |
x with cleaned spectra.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.