set_calc_variability: Calculate parameters of variability for a given set of...

Description Usage Arguments Details Value See Also Examples

Description

Calculate mean, standard deviation and coefficient of variation for groups of values.

Usage

1

Arguments

data

A tibble containing the data.

ids

The column holding the names used to group the values.

...

The name(s) of the columns used to calculate the variability.

Details

Dealing with measured values, the measurement of sample "A" is often done in duplicates / triplicates / ... . This function groups all samples with the same name and calculates mean, standard deviation and coefficient of variation (= sd / mean).

Value

A tibble containing all original and additional columns (NAMEA_mean, NAMEA_n, NAMEA_sd, NAMEA_cv, (NAMEB_mean, ...)).

See Also

Other set functions: set_calc_concentrations, set_read, sets_read

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# generate data
library("tibble")

data <- tibble(
  names = c("A", "B", "C", "A", "B", "C"),
  value = c(19, 59, 22, 18, 63, 28),
  conc = c(1.9, 5.9, 2.2, 1.8, 6.3, 2.8)
)

data

set_calc_variability(
  data = data,
  ids = names,
  value,
  conc
)

# to set column names use notation like in dplyr / tidyverse
## Not run: 
# notice how strings are given as column names
set_calc_variability(
  data = data,
  ids = "names",
  "value",
  "conc"
)

## End(Not run)

rm(cals)

bioset documentation built on May 2, 2019, 4 p.m.