ch.plotTwoLinearFits | R Documentation |
This function fits two linear functions; plots the two functions on a single graph; and returns a list with the fit statistics.
ch.plotTwoLinearFits(
data,
xCol,
y1Col,
y2Col,
minN = NULL,
y1Label = NA,
y2Label = NA,
parOp = NULL,
cex1 = 1.25,
cex.topTile = 1.25,
printR2 = T,
topTitle = NULL,
ylimMin1 = 0,
ylimMax1 = 0,
ylimMin2 = 0,
ylimMax2 = 0,
filename = NULL,
...
)
data |
a dataframe. |
xCol |
a string that specifies the name of the column in "data" that contains the data for the x-axis. |
y1Col |
a string that specifies the name of the column in "data" that contains the the first DV to be fit. |
y2Col |
a string that specifies the name of the column in "data" that contains the the second DV to be fit. |
minN |
an integer indicating the minimum number of trials in each condition that is valid for analysis. Below that number, the condition will be removed. DEFAULT = NULL. |
y1Label |
a string that specifies the y-axis label name for the y1Fit. DEFAULT = NA. |
y2Label |
a string that specifies the y-axis label name for the y2Fit. DEFAULT = NA. |
parOp |
a list with the par options (see par). If NULL, then the functions default par options will be used. DEFAULT = NULL. |
cex1 |
sets the default font size. DEFAULT = 1.25. |
cex.topTile |
sets the default font size of the title at the top of the page. DEFAULT = 1.25. |
printR2 |
a boolean that determines whether to print the r square on the graph. DEFAULT = FALSE. |
topTitle |
a string that will be the title at the top of the page. DEFAULT = NULL. |
ylimMin1 |
a number denoting the minimum of the y-axis for graph 1. DEFAULT=0. |
ylimMax1 |
a number denoting the maximum of the y-axis for graph 1. DEFAULT=0. If ylimMin1 == ylimMax1, the function determines a |
ylimMin2 |
a number denoting the minimum of the y-axis for graph 2. DEFAULT=0. |
ylimMax2 |
a number denoting the maximum of the y-axis for graph 2. DEFAULT=0. If ylimMin2 == ylimMax2, the function determines a |
filename |
the filename (pdf) to save the output of the graph. DEFAULT = NULL (no graph saved) |
a list containing: y1Fit = lm object with the fit of the y1 data; y2Fit = the lm object with the fit of the y2 data.
ch.plotTwoLinearFits (data=moralsData,"overlapRound", "resdRT", "correct", c("yes", "no"), filename = "plot.pdf")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.