Description Usage Arguments Value Author(s) Examples
A function that takes experiments (columns) of an NTB dataset and visualizes the data as customized boxplots. Requires function 'getexpdata' internally. For right formatting of your files, please consider the "ReadMe for ntbgraphics".
1 2 3 4 5 6 7 8 9 10 | ploteachexp(
expname,
directory,
analysis = c("2arm_ko", "2arm_tg", "2arm_sd", "2arm_treat", "4arm_sd_ko",
"4arm_sd_tg", "4arm_treat_ko", "4arm_treat_tg"),
exclude.animals = FALSE,
orderlevelcond = c("other", "gtblock", "etblock", "2rev"),
acceptable.nas = "unlimited",
saveplotdir = directory
)
|
expname |
name of an experiment respectively column in dataframe of the NTB dataset to be analyzed within quotation marks; no default |
directory |
specifies file directory of 'Meta Behavior' and 'Animal List' files within quotation marks (mind correct spelling of both files and 'directory'!); no default |
analysis |
specifies the kind of experiment performed within quotation marks; "2arm_ko","2arm_tg", "2arm_sd", "2arm_treat", "4arm_sd_ko", "4arm_sd_tg", "4arm_treat_ko", "4arm_treat_tg" (tg for transgenic, ko for knockout; 4arm_sd_x assumes a stress paradigm with social defeat (sd) and housing or handling control (hc) as control; 4arm_treat_x assumes a treatment paradigm with treated (treat) and untreated (untreat) animals; 2arm_x assumes wildtype controls (wt) for tg and ko, housing or handling controls (hc) for sd and untreated controls (untreat) for treated animals; ('analysis' defines the kind of experiment performed, respectively the kind of analysis preferred - you can easily perform 2arm analysis for 4arm experiments looking only at the groups of interest, but not the other way around); default: "2arm_ko" |
exclude.animals |
excluding animals from analysis by RFID; user has to provide a vector containing characters within quotation marks (e.g. by using c("900200000067229", "900200000065167")) with all animals he wants to exclude from the final plotting; if FALSE is provided, no animal will be excluded; default: FALSE |
orderlevelcond |
defines order of boxplots in plot within quotation marks: "other", "gtblock", "etblock", "2rev"; "other" for alphabetical order in case of 4arm; also for default order of 2arm experiments (which displays the 'control' first, then the 'condition'); "gtblock" for order wt_x, wt_y, tg_x, tg_y; "etblock" for order x_hc, y_hc, x_sd, y_sd; "2rev" for inverse order of 2arm default only, meaning displaying the 'condition' first, then the 'control'; default: "other" |
acceptable.nas |
defines the maximum number of NAs allowed within the same row; if number of actual NAs within one row is bigger than the number provided, the row will be excluded from table and following plotting; if the number of acceptable NAs should be unlimited, no value has to be provided; default: "unlimited" |
saveplotdir |
file directory where to save plots within quotation marks; you may set to FALSE if you do not want to save plot to PDF; default: location of Behavior and Animal List files as specified in 'directory' |
boxplot, optionally saved as PDF
Paul Volkmann
1 2 3 4 5 6 7 8 9 10 | ploteachexp(expname = "Meanspeed",
directory = paste0(system.file("extdata", package = "ntbgraphics", mustWork = T),"/"))
ploteachexp(expname = "Center",
directory = paste0(system.file("extdata", package = "ntbgraphics", mustWork = T),"/"),
analysis = "4arm_sd_tg",
exclude.animals = c("900200000068816"),
orderlevelcond = "etblock",
acceptable.nas = 4,
saveplotdir = paste0(system.file("../plots", package = "ntbgraphics", mustWork = T),"/"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.