plot_import | R Documentation |
plot_import
plots a single participant's data from import_single()
,
or a single participant (if !is.null(id)
), or all participants' data
from import_multiple()
.
plot_import(
parsed_list,
import_single = FALSE,
id = NULL,
types = c("train", "test", "affect"),
plt.train = list(),
plt.test = list(),
plt.affect = list(),
grp_compare = NULL,
grp_names = c(),
recode_na = NULL,
aff_by_reward = FALSE,
legend_pos = "right",
pal = NULL,
font = "",
font_size = 14,
...
)
parsed_list |
|
import_single |
Is the output from |
id |
subjID to select if only plots for a single participant are desired. Will also accept a single numeric value i, which will select the ith participant in the output. |
types |
Types of plot to output, choose from any (or all) of
|
plt.train |
List of length <= 2, with the first element a single value or numeric vector of the number of trials to lag in the calculation of cumulative probabilities, and the second element a vector of training types to include. |
plt.test |
List of length <= 2. The first element specifies the types of test pairs to plot; accepted inputs include "chooseA", "avoidB", "novel", "training", "all", and/or character vector(s) of specific pairs. The second input defines how these options are plotted - either "grouped" or "individual"; note "grouped" plots will not work for custom inputs or if "all" is selected as an option. |
plt.affect |
List of length <= 2 indicating (1) how many trials to lag (only a single value accepted), and (2) the nouns to plot (can be any of "happy", "confident", "engaged", or "fatigue"; defaults to all types). |
grp_compare |
Group to compare on which is found from the participant
info. Note that if |
grp_names |
Vector of labels for plot keys for the different groups. An attempt will be made to label these automatically; it is recommended to first leave this list empty to make sure the correct labels are applied. |
recode_na |
Some grouping variables are |
aff_by_reward |
Enables affect plots to be compared by whether or not the prior stimulus was rewarded or not. This will override grp_compare (but won't affect other types of plots). |
legend_pos |
Enables the legend positions to be set manually. |
pal |
Define a custom colour palette for the plots? Otherwise reverts to defaults. |
font |
Use a custom font for the plots? |
font_size |
Base plot font size. |
... |
Other arguments, used internally by other functions calling this one. |
Either a single or named list
of ggplot
objects.
# Plot twenty-trial lagged training data, by distancing group
plot_import(
example_data,
types = "train",
plt.train = list(20),
grp_compare = "distanced"
)
# Plot test data for training and novel types, by sex
plot_import(
example_data,
types = "test",
plt.test = list(c("training", "novel"), "individual"),
grp_compare = "sex"
)
# Block end-of-block fatigue ratings in the non-distanced group only
plot_import(
example_data$nd,
types = "affect",
plt.affect = list(20, "fatigue")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.