Learn R Programming

mefa (version 3.1-0)

fill.na: Replace Values with Nearest Above Values

Description

The function replaces values with the nearest values above them in the same column.

Usage

fill.na(x)

Arguments

x
a matrix or data frame.

Value

  • A matrix or a data frame.

encoding

UTF-8

Details

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.

References

S'olymos{Solymos} P. (2008) mefa: an R package for handling and reporting count data. Community Ecology 9, 125--127.

S'olymos{Solymos} P. (2009) Processing ecological data in R with the mefa package. Journal of Statistical Software 29(8), 1--28. http://www.jstatsoft.org/v29/i08/

http://mefa.r-forge.r-project.org/

See Also

stcs

Examples

Run this code
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)

Run the code above in your browser using DataLab