fill.na {mefa} | R Documentation |
The function replaces <NA>
values with the nearest values above them in the same column.
fill.na(x)
x |
a matrix or data frame. |
This function is useful when converting a 'notebook style' data into an 'stcs' object. The 'notebook style' data means that observations are registered in a non-redundant way, e.g. when typing in a spreadsheet.
A matrix or a data frame.
This function is not vectorized, so can be a bit slow for large data sets.
Péter Sólymos, solymos@ualberta.ca
Sólymos P. 2008. mefa: an R package for handling and reporting count data. Community Ecology 9, 125–127.
http://mefa.r-forge.r-project.org/
x <- data.frame( samp = c("s1",NA,"s2",NA,"s3","s4"), taxa = c("t1",NA,"s1","s2","s3",NA), count = c(1, 2, 10, 3, 4, 1), segm = c("male","female","male","female","male","male")) x fill.na(x)