choose_test.date: Filter the final result of the object date

Description Usage Arguments Value Examples

View source: R/date.R

Description

Filter the final result of the object date

Usage

1
2
## S3 method for class 'date'
choose_test(obj, test = "out", group_id = T)

Arguments

obj

An object for calculation. Class date.

test

A character scalar. Parameters, which use to filter the final dataset, default: "out": "out" - dates, which are out of the protocol's timeline, "uneq" - dates, which are unequal, "ok" - correct dates, "skip" - empty dates.

group_id

A logical scalar, default is TRUE.True is grouped by id, otherwise, it isn't grouped.

Value

The dataset by a value of test.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
id <- c("01", "02", "03")
screen_date_E1 <- c("1991-03-13", "1991-03-07", "1991-03-08")
rand_date_E2 <- c("1991-03-15", "1991-03-11", "1991-03-10")
ph_date_E3 <- c("1991-03-21", "1991-03-16", "1991-03-16")
bio_date_E3 <- c("1991-03-23", "1991-03-16", "1991-03-16")

df <- data.frame(id, screen_date_E1, rand_date_E2, ph_date_E3, bio_date_E3,
  stringsAsFactors = FALSE
)

timeline <- system.file("dates.xlsx", package = "dmtools")
obj_date <- date(timeline, id, dplyr::contains)

obj_date <- check(obj_date, df)
choose_test(obj_date, "out")

dmtools documentation built on Nov. 9, 2020, 9:06 a.m.