summarize_measurements | R Documentation |
Finds minimum, maximum and standard deviation of force per measurement and taxon and creates summary tibble.
summarize_measurements(df, var1, var2)
df |
Data frame or tibble containing at least three columns. The column names must contain the
grouping variables defined in |
var1 |
A character string defining the column to calculate minimal and maximal force values per measurement. This must be the column that contains the unique measurement ID, e.g. measurement number. |
var2 |
A character string defining the column for which the summary should be calculated. |
A tibble summarizing the input data frame df
. The resulting tibble will contain
the columns t
, force
, measurement
, species
, specimen
, amp
, lever.ratio
,
max.F.measurement
, mean.F.specimen
, max.F.specimen
, sdv.max.F.specimen
, n.measurements.in.specimen
.
# Using the forceR::df.all.200.tax dataset: # sumarize by measurement and specimen df.summary.specimen <- summarize_measurements(df = df.all.200.tax, var1 = "measurement", var2 = "specimen") # plot results ## Not run: require(ggplot2) ggplot(data = df.summary.specimen, mapping = aes(x=specimen,y=max.F.measurement)) + geom_jitter(aes(color='blue'),alpha=0.7) + geom_boxplot(fill="bisque",color="black",alpha=0.3) + # scale_y_log10() + labs(y="max(F)/specimen") + guides(color="none") + theme_minimal() ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.