# scan through a data frame of characters
scan_result <- scan_data(
data = readRDS(
system.file("extdata", "messy_data.RDS", package = "cleanepi")
)
)
# scan through a data frame with two character columns
scan_result <- scan_data(
data = readRDS(system.file("extdata", "test_linelist.RDS",
package = "cleanepi"))
)
# scan through a data frame with no character columns
data(iris)
iris[["fct"]] <- as.factor(sample(c("gray", "orange"), nrow(iris),
replace = TRUE))
iris[["lgl"]] <- sample(c(TRUE, FALSE), nrow(iris), replace = TRUE)
iris[["date"]] <- as.Date(seq.Date(from = as.Date("2024-01-01"),
to = as.Date("2024-08-30"),
length.out = nrow(iris)))
iris[["posit_ct"]] <- as.POSIXct(iris[["date"]])
scan_result <- scan_data(data = iris)
Run the code above in your browser using DataLab