Data Science Desktop Survival Guide
by Graham Williams |
|||||
Identify Numeric Variables |
We identify the numeric variables of a dataset by purrr::map()ing the function base::is.numeric() to find base::which() are numeric. Their names are stored into the variable numc.
# Note which variables are numeric.
vars %>% setdiff(ignore) %>% extract(ds, .) %>% sapply(is.numeric) %>% which() %>% names() %T>% print() -> numc ## Error in as.vector(y): object 'ignore' not found
|