unify_taxonomy: Unify taxonomy of counts in multiple objects

Description Usage Arguments Value Examples

View source: R/EPDr-manipulate_lists_functions.R

Description

This function compares the taxa registered in a list of epd.entity.df-class objects and expand their taxonomy (using filter_taxa) to make them match. When neccesary the function add empty columns (with NA values).

Usage

1
unify_taxonomy(list, epd.taxonomy, na_value = 0)

Arguments

list

List of epd.entity.df-class objects to be modified.

epd.taxonomy

Data frame with the taxonomy from the EPD as from the get_taxonomy_epd function.

na_value

numeric Number indicating the value to be used for taxa not previously present in the entities.

Value

list of epd.entity.df-class objects with taxonomy modified.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
epd.connection <- connect_to_epd(host="localhost", database="epd",
                               user="epdr", password="epdrpw")
e.list <- listE(epd.connection, country=c("Spain"))
e.list <- e.list$e_
spain <- lapply(e.list, get_entity, epd.connection)
spain.ut <- unify_taxonomy(spain, get_taxonomy_epd(epd.connection))
colnames(spain[[1]]@commdf@counts)
colnames(spain.ut[[1]]@commdf@counts)

## End(Not run)

dinilu/EPDr documentation built on Jan. 13, 2018, 9:03 p.m.