filter.META: Select METADATA Variables

Description Usage Arguments Value Author(s) Examples

Description

This function will remove metadata variables with only one level and /or remove variables with missing data or neither numeric nor factor/character (NNF).

Usage

1
2
filter.META(meta=meta, excl.na=TRUE, excl.NNF=TRUE, 
            exclude=NULL)

Arguments

meta

the metadata table to be analyzed.

excl.na

logical. Whether or not remove variables that contain missing data.

excl.NNF

logical. Whether or not remove variables that neither are numeric nor factor/character.

exclude

optional. If is NULL, the function only removes variables with only one level or NNF. Otherwise, the variables in the exclude will also be removed from the metadata table.

Value

The value returned by this function is a data frame with the following metadata variables being removed: 1) with missing data; 2) NNF if excl.NNF is TRUE; and 3) in the exclude list.

Author(s)

Wen Chen

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(meta)
## Not run: 
# add a new column with NA
meta.nw <- meta
meta.nw$na <- c(rep(NA, nrow(meta.nw)-3), c(1, 3, 5))
meta.nw$nf <- rep("Canada", nrow(meta.nw))
meta.fil <- filter.META(meta.nw)
meta.fil <- filter.META(meta.nw, excl.na=FALSE, excl.NNF=FALSE,
                        exclude=c("Province", "Latitude"))

## End(Not run)

Example output

Loading required package: vegan
Loading required package: permute
Loading required package: lattice
This is vegan 2.5-4
Loading required package: ggplot2
sh: 1: cannot create /dev/null: Permission denied
sh: 1: cannot create /dev/null: Permission denied
[1] "A total of  3  columns are removed:  na, nf, Harvestdate"
[1] "columns in exclude list: "
[1] "column# with missing data: 11"
[1] "columns# with one level: 12"
[1] "column# that are not numeric or factor: 6"
Warning message:
In is.na(x) : is.na() applied to non-(list or vector) of type 'NULL'
[1] "A total of  4  columns are removed:  Province, Latitude, nf, Harvestdate"
[1] "columns in exclude list: 8, 9"
[1] "column# with missing data: "
[1] "columns# with one level: 12"
[1] "column# that are not numeric or factor: 6"
Warning message:
In is.na(x) : is.na() applied to non-(list or vector) of type 'NULL'

RAM documentation built on May 2, 2019, 3:04 p.m.