is_cpass_data.Rd
Checks if data is a "CPASS" data.frame.
is_cpass_data(data, silent = TRUE)
a data.frame that contains symptoms reported subjects.
The data must be in a long format and have the following columns:
subject
, cycle
, day
, DRSP
, drsp_score
(optional) logical, default = TRUE
.
Should warning messages be printed?
a logical.
random_data =
expand.grid(
subject = 1,
cycle = 1:2,
day = c(1:10,-10:-1),
item = 1:24)
random_data$drsp_score = sample(1:6, nrow(random_data), replace = TRUE)
cpass_data = as_cpass_data(random_data, sep_event = "menses")
#> Number of subjects: 1
#> Total number of cycles: 2
#> Percentage of missing scores: 0 %
#> Percentage of missing scores
#> (in pre- & post-menstrual phases): 0 %
colnames(cpass_data)
#> [1] "subject" "cycle" "phase" "day" "item"
#> [6] "drsp_score"
is_cpass_data(random_data)
#> [1] FALSE
is_cpass_data(cpass_data)
#> [1] TRUE