basic_stats | R Documentation |
Calculates basic stats (mean and standard error) for each applicable column in
an exdf
object split up according to the values of one or more
identifier columns.
basic_stats(
exdf_obj,
identifier_columns,
na.rm = TRUE
)
exdf_obj |
An |
identifier_columns |
The name(s) of one or more columns in a vector or list that can be used to
split |
na.rm |
A logical value indicating whether or not to remove NA values before calculating means and standard errors. |
This function first splits up exdf_obj
into chunks according to the
values of the identifier_columns
. For each chunk, columns that have a
single unique value are identified and excluded from the statistical
calculations. For the remaining numeric columns, the mean and standard error
are calculated.
An exdf
object including the mean and standard error for each
applicable column, where each row represents one value of the
identifier_columns
. The column names are determined by appending
'_avg'
and '_stderr'
to the original names.
# Read an example Licor file included in the PhotoGEA package
licor_file <- read_gasex_file(
PhotoGEA_example_file_path('ball_berry_1.xlsx')
)
# Calculate the average assimilation and stomatal conductance values for each
# species. (Note: this is not a meaningful calculation!)
basic_stats(
licor_file[ , c('species', 'K', 'A', 'gsw'), TRUE],
'species'
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.