plot_subject_data_and_dx.Rd
By default, this function saves the visualization in a pdf. The pdf heigth scales with the number of cycles reported for the subject.
plot_subject_data_and_dx(
data = data.frame(),
save_as_pdf = TRUE,
pdf_path = "",
pdf_name = "",
color_max_score = "tomato",
color_summary = c("complementary", "rainbow")
)
a cpass
data.frame that
contains the symptoms reported by ONE subject.
logical.
If TRUE
(default), this function saves the visualization in a pdf.
The pdf path and name can be specified with the arguments
pdf_path
and pdf_name
.
If FALSE
, this function returns a ggplot object.
The same object is also returned, but invisibly,
when save_as_pdf = TRUE
(see examples).
string. Specifies the path to the folder in which the pdf should be saved. By default, the path is an empty string so the pdf is be saved in the current working directory.
string. Specifies the name of the pdf.
By default, the name of the pdf is CPASS_SUBJECT_X.pdf
,
where X
is replaced by the subject unique identifier.
string specifying the color of a score of 6
(the maximal score) reported by a subject.
Any standard color format specification is accepted,
i.e. one of the R built-in color names
(e.g. "tomato" (default);
type colors()
to see the names of all R built-in colors),
an RGB hex code (e.g. "#AA2199") or
a color specified via one of the color/palette functions
(e.g. hsv(0.1,0.9,0.9))
string.
Either "complementary"
(default) or "rainbow"
specifying the type of color scheme for the ITEM items
in the diagnosis summary.
If "complementary"
, the colors are chosen complementary
within a domain; if "rainbow"
,
the item colors are different for each item and
chosen from a rainbow palette.
a ggplot object if save_as_pdf = FALSE
.
The same object is returned invisibly by default
(save_as_pdf = TRUE
).
library(magrittr)
library(dplyr)
data(PMDD_data)
input =
PMDD_data %>%
dplyr::filter(subject == 2) %>%
as_cpass_data(., sep_event = "menses")
#> Number of subjects: 1
#> Total number of cycles: 2
#> Percentage of missing scores: 13.1 %
#> Warning: The 'phase' column will be over-written
#> Percentage of missing scores
#> (in pre- & post-menstrual phases): 13.1 %
p = plot_subject_data_and_dx(data = input)
#> Subject summary saved in ' /Users/laurasymul/Documents/Work/Research/Packages/cpass/docs/reference/CPASS_SUBJECT_2.pdf '
p