View source: R/BiomechanicsFunctions.R
profilePlotR | R Documentation |
The following function calculates the summary statistics for groups that have multiple observations and then plots the mean and confidence interval for each group. The confidence interval is based on the lower and upper Gaussian confidence limits based on the t-distribution.
profilePlotR(d = d, xvar = xvar, yvar = yvar, groupname = groupname, xlab = "x", ylab = "y", colorPalette = c("#D55E00", "#0072B2", "#56B4E9"), linetypes = NULL, grouplevels = NULL, title = NULL, ...)
|
data (currently only accepts input for one variable at a time). |
|
x-axis variable name. |
|
y-axis variable name. |
|
variable name for the overall group that is being evaluated (e.g., species). |
|
character string for the x-axis label. |
|
character string for the y-axis label. |
|
character string of colors to use for plot. |
|
character string of lines to use for each group. |
|
character string of the text to print for each group in the legend. |
|
character string for the title of the plot. |
Function to quickly generate profile plots for data. For instance, kinematic plots over time for multiple individuals that have multiple trials of data collected.
percentStance = rep(seq(1,5),4) yank = c(0.00062, 0.00172, 0.00269, 0.00346, 0.00412, 0.0022, 0.00072, 0.00169, 0.00246, 0.00312, 0.00028, 0.00084, 0.00151, 0.00239, 0.00340, 0.00041, 0.00122, 0.00202, 0.00277, 0.00341) species = c("ab" , "ab", "ab", "ab", "ab", "ab", "ab", "ab", "ab", "ab", "cd", "cd", "cd", "cd", "cd", "cd", "cd", "cd", "cd", "cd") df <- data.frame(percentStance, yank, species) cbPalette <- c("#D55E00", "#0072B2") grouplevels = c("Aa bb", "Cc dd") profilePlotR(df, "percentstance", "yank", "species", "Percent Stance", "Yank (BW per sec)", colorpalette = cbPalette, grouplevels = grouplevels)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.