scatter: Scatter each taxon in a taxondf to a taxon object

View source: R/scatter.R

scatterR Documentation

Scatter each taxon in a taxondf to a taxon object

Description

Scatter each taxon in a taxondf to a taxon object

Usage

scatter(x, ...)

assemble(x, ...)

## S3 method for class 'taxa'
assemble(x, ...)

Arguments

x

A taxonomic data.frame

...

Further args, ignored for now

Details

Right now, assemble may not give back the identical data.frame that one would pass to scatter.

Value

Gives a taxa object, with each individual component a row from your data.frame, and of class taxon

Examples

# operating on taxonomic data.frames
df <- data.frame(class=c('Magnoliopsida','Magnoliopsida','Magnoliopsida',
                         'Magnoliopsida','Magnoliopsida','Magnoliopsida'),
         order=c('Asterales','Asterales','Fagales','Poales','Poales','Poales'),
         family=c('Asteraceae','Asteraceae','Fagaceae','Poaceae','Poaceae','Poaceae'),
         genus=c('Helianthus','Helianthus','Quercus','Poa','Festuca','Holodiscus'),
         stringsAsFactors = FALSE)
(df2 <- taxon_df(df))

## scatter each taxon into a taxon class
df2 %>% scatter()

## re-assemble
df2
df2 %>% scatter()
df2 %>% scatter() %>% assemble

ropensci/binomen documentation built on May 18, 2022, 9:47 a.m.