Sometimes some samples are collected and analyzed, later another batch of samples is analyzed. This function tries to detect if there are problems with the data or when the data is combined in a single analysis. To know specific problems with the data you need to use check_data()
Usage
valid_followup(
old_data = NULL,
new_data = NULL,
all_data = NULL,
omit = NULL,
column = "batch"
)
Arguments
- old_data, new_data
A data.frame with the old and new data respectively.
- all_data
A
data.frame
with all the data about the samples. Each row is a sample.- omit
Name of the columns of the
pheno
that will be omitted.- column
The name of the column where the old data has the batch information, or whether the data is new or not (
NA
) in the case of all_data.
Value
Called by its side effects of warnings, but returns a logical value
if there are some issues (FALSE
) or not (TRUE
)
Examples
data(survey, package = "MASS")
survey1 <- survey[1:118, ]
survey2 <- survey[119:nrow(survey), ]
valid_followup(survey1, survey2)
#> Warning: There are some problems with the data.
#> Warning: There are some problems with the new samples and the batches.
#> Warning: There are some problems with the new data.
#> Warning: There are some problems with the old data.
#> [1] FALSE
survey$batch <- NA
survey$batch[1:118] <- "old"
valid_followup(all_data = survey)
#> Warning: There are some problems with the data.
#> Warning: There are some problems with the new samples and the batches.
#> Warning: There are some problems with the new data.
#> Warning: There are some problems with the old data.
#> [1] FALSE