View source: R/lifetable_data.R
| get_stage_names | R Documentation |
Extracts the names of the developmental stages from the header (first
row) of a life table csv file. The header is truncated at the sex
column, the ID column is dropped, and the two adult labels before the
sex column are replaced by "Female" and "Male".
get_stage_names(lt)
lt |
A |
Stage names are taken from the header exactly as they are
spelled in the csv file, so English headers produce English stage
names and Chinese headers produce Chinese stage names. Only the two
adult labels are always converted to "Female" and
"Male". Internally the sex column is located by matching the
header entry gender and the ID column by the header entry
ID (both are fixed parts of the csv template).
A character vector of stage names, e.g.
c("Egg", "Larva", "Pupa", "Female", "Male"); used as column
names by calc_sxj and as legend labels by
lifeTable_plot.
lifeTable_read, calc_sxj,
lifeTable_plot
lt <- lifeTable_read(system.file("extdata", "lifetable_example.csv",
package = "insectecol"))
get_stage_names(lt)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.