varType | R Documentation |
Determine Types of Variables
varType(data, include = NULL, exclude = NULL, ndistinct = 10, nnonnum = 20)
data |
data frame or table to analyze |
include |
formula or vector of variable names to attend to |
exclude |
a formula or character vector specifying which variables to exclude from consideration |
ndistinct |
minimum number of distinct numeric values a variable must have to be considered continuous |
nnonnum |
maximum number of distinct values a variable can have to be considered discrete |
For all the variables in a data frame/table, analyzes them to determine types: continuous, nonnumeric, and discrete. include
and exclude
can be vector or right-side-only formulas.
list
of vectors
Frank Harrell
set.seed(1)
d <- data.frame(i=1:100, x=runif(100), y=sample(1:3, 100, TRUE),
w=sample(c('cat','dog','giraffe'), 100, TRUE),
v=sample(letters, 100, TRUE))
varType(d)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.