Description Usage Arguments Details Value Examples
A plot method for "FemFit" objects.
1 2 3 4 |
x |
An "FemFit" object. |
formula |
Specifies the response variable and up to two facetting variables. Must not be a variable used in the |
colorCode |
A variable color the pressure traces of the response. Must not be a variable used in the |
subset |
A conditional expression to subset |
timeScale |
A numeric constant used to divide |
xlab |
Label the x-axis. |
ylab |
Label the y-axis. Defaults to the name of the response variable specified in |
main |
Label the title. |
printPlot |
A logical constant to set whether |
... |
Other arguments not used by this method. |
The formula
has up to three components, y ~ facet_1 + facet_2
. y
is a variable found in x$df
and has special exceptions to grab all sensors when y = prssr_sensor
, y = zeroPrssr
, or y = tmprtr_sensor
.
If you do not want to facet, use .
in the RHS of the formula.
There is a special keyword, sensor
, which allows the user to facet the pressure traces by sensor number or color the pressure traces by sensor number.
xlab
defaults to "Time (s)" if timeScale = 1000
and xlab = "Time (ms)"
.
timeScale
, xlab
, ylab
, main
, and printPlot
only uses the first element if there is a vector input.
plot.FemFit
silently returns a ggplot2
object which can then be edited.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # Load in the FemFit dataset
session488 = read.FemFit("./Datasets_AukRepeat/2c2cc798481d05da_488_csv.zip")
# Plot the FemFit dataset with the default arguments
plot(session488)
# The absence of the `sensor` keyword in the formula argument simultaneously plots all pressure traces with an opacity value fo 25%
plot(session488, formula = prssr_sensor ~ sessionID)
# Utilising the `sensor` keyword in the colorCode argument plots all pressure traces with a unique color.
plot(session488, formula = prssr_sensor ~ sessionID, colorCode = sensor)
# Use subset to plot a portion of the FemFit dataset
plot(session488, subset = JSONLabel == "pfmc3x5s_rest30s")
# xlab, ylab, and title must be character inputs. So, here is the current work-around to use mathematical symbols for those fields
plotObj = plot(session488, formula = zeroPrssr ~ sensor + sessionID, printPlot = FALSE)
plotObj = plotObj + labs(y = expression("Zeroed Pressure ("*Delta*"mmHg)"))
print(plotObj)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.