| detect_types | R Documentation |
Inspects each column and returns a best-guess R type string. Character columns are tested for common date patterns. Numeric columns containing only 0/1 values (with both present) are flagged as logical.
detect_types(df)
df |
A data frame. |
A named character vector with one element per column.
Possible values: "numeric", "integer", "character",
"logical", "factor", "Date", "POSIXct",
"unknown".
df <- data.frame(
price = c(100.5, 200.3, 300.1),
rooms = c(2L, 3L, 4L),
pool = c("Y", "N", "Y"),
sold = c(TRUE, FALSE, TRUE)
)
detect_types(df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.