Learn R Programming

binomen (version 0.1.2)

scatter: 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 taxa assemble(x, ...)

Arguments

x
A taxonomic data.frame
...
Further args, ignored for now

Value

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

Details

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

Examples

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

Run the code above in your browser using DataLab