View source: R/create_schema.R
create_schema | R Documentation |
Creates a Table Schema for a data frame, listing all column names and types as field names and (converted) types.
create_schema(data)
data |
A data frame. |
See vignette("table-schema")
to learn how this function implements the
Data Package standard.
List describing a Table Schema.
Other create functions:
create_package()
# Create a data frame
df <- data.frame(
id = c(as.integer(1), as.integer(2)),
timestamp = c(
as.POSIXct("2020-03-01 12:00:00", tz = "EET"),
as.POSIXct("2020-03-01 18:45:00", tz = "EET")
),
life_stage = factor(c("adult", "adult"), levels = c("adult", "juvenile"))
)
# Create a Table Schema from the data frame
schema <- create_schema(df)
str(schema)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.