Learn R Programming

dataset (version 0.4.1)

as.data.frame.dataset_df: Convert a dataset_df to a base data.frame

Description

Converts a dataset_df into a plain data.frame. By default this strips semantic metadata (label, unit, concept/definition, namespace) from each column, but this can be controlled via the strip_attributes argument.

Dataset-level metadata remains attached as inert attributes.

Usage

# S3 method for dataset_df
as.data.frame(
  x,
  ...,
  strip_attributes = TRUE,
  optional = FALSE,
  stringsAsFactors = FALSE
)

Value

A base R data.frame without the dataset_df class.

Arguments

x

A dataset_df.

...

Passed to base::as.data.frame().

strip_attributes

Logical: should column-level semantic metadata be stripped? Default: TRUE.

optional

logical. If TRUE, setting row names and converting column names (to syntactic names: see make.names) is optional. Note that all of R's base package as.data.frame() methods use optional only for column names treatment, basically with the meaning of data.frame(*, check.names = !optional). See also the make.names argument of the matrix method.

stringsAsFactors

logical: should the character vector be converted to a factor?

Examples

Run this code
data(orange_df)
as.data.frame(orange_df)

Run the code above in your browser using DataLab