View source: R/epi_clean_count_classes.R
epi_clean_count_classes | R Documentation |
Count by column type in a data frame. Uses dplyr and purrr, useful when handling large data frames (hundreds of columns and thousands of observations for example).
epi_clean_count_classes(df = NULL)
df |
data frame object with columns to count |
Returns a table with the counts of column types contained in the data frame.
Note that columns with more than one class will be counted each time (such as POSIX dates), hence ncol() and epi_clean_count_classes() may not match
Antonio Berlanga-Taylor <\url{https://github.com/AntonioJBT/episcout}>
epi_clean_cond_numeric
,
epi_clean_class_to_factor
,
epi_clean_cond_date
.
## Not run:
set.seed(12345)
n <- 20
df <- data.frame(
var_id = rep(1:(n / 2), each = 2),
var_to_rep = rep(c('Pre', 'Post'), n / 2),
x = rnorm(n),
y = rbinom(n, 1, 0.50),
z = rpois(n, 2)
)
df$date_col <- seq(as.Date("2018/1/1"), by = "year", length.out = 5)
epi_clean_count_classes(df)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.