interpolate {mmodely}R Documentation

Interpolate missing data in a data frame

Description

This function finds NA values and interpolates using averaging values of nearby genus and species

Usage

interpolate(df, taxa=c('genus','family'), clmns=1:length(df))

Arguments

df

a data frame

taxa

a vector of taxonomic ranks (corresonding to columns) to assist in guiding the interpolating

clmns

the names of the columns to interpolate over

Value

a modified data frame without missing values in the columns specified

Examples


path <- system.file("extdata","primate-example.data.csv", package="mmodely")
gs.tab <- read.csv(path, row.names=1)

clmns <- match(c('mass.Kg','DPL.km'),names(gs.tab))
df.2 <- interpolate(df=gs.tab, taxa='genus', clmns=clmns)


[Package mmodely version 0.2.5 Index]