fb_parse: Parse data from non-standard traits

Description Usage Arguments Value Examples

View source: R/fb_parse.R

Description

Parse data from non-standard traits

Usage

1
fb_parse(fbt, traits, sep = ":", n.obs = 10)

Arguments

fbt

A Field Book Table object.

traits

A character vector of trait names identifying which column(s) in the fbt object file to parse.

sep

Character(s) used to split the multicat data entries.

n.obs

An numeric vector of integers describing the number of desired datapoint observations in a multicat trait. The first n observations will be included and the remainder discarded For instance, if one of the multicat data points was "1:2:3:4:5" and n.obs was set to 3, the resulting data would be "1 2 3". The vector must be the same length as 'traits.'

Value

An fbt object with un-parsed trait columns and with with individual columns for each datapoint entry in each multicat trait. The mean and standard deviation of all datapoint entries are also included.

Examples

1
2
3
4
data("fbt_sample")

# Parse the 'Multi' trait
fbt1 <- fb_parse(fbt = fbt_sample, traits = "Multi", sep = ":")

neyhartj/fbutils documentation built on Feb. 10, 2020, 1:45 p.m.