Learn R Programming

dataset (version 0.3.4)

dataset_df: Create a new dataset_df object

Description

The dataset_df constructor creates the objects of this class, which are semantically rich, modern data frames inherited from tibble::tibble.

Usage

dataset_df(
  ...,
  dataset_bibentry = NULL,
  var_labels = NULL,
  units = NULL,
  definitions = NULL,
  dataset_subject = NULL
)

as_dataset_df( df, var_labels = NULL, units = NULL, definitions = NULL, dataset_bibentry = NULL, dataset_subject = NULL, ... )

is.dataset_df(x)

# S3 method for dataset_df print(x, ...)

is_dataset_df(x)

Value

dataset_df is the constructor of this type, it returns an object inherited from a data frame with semantically rich metadata.

is.dataset_df returns a logical value (if the object is of class dataset_df.)

Arguments

...

The vectors (variables) that should be included in the dataset.

dataset_bibentry

A list of bibliographic references and descriptive metadata about the dataset as a whole created with datacite or dublincore.

var_labels

The long, human readable labels of each variable.

units

The units of measurement for the measured variables.

definitions

The linked definitions of the variables, attributes, or constants.

dataset_subject

The subject of the dataset, see subject.

df

A data.frame to be converted to dataset_df.

x

A dataset_df object for S3 methods.

Details

To check if an object has the class dataset_df use is.dataset_df.

print is the method to print out the semantically rich data frames created with the constructor of dataset_df.

summary is the method to summarise these semantically rich data frames.

For more details, please check the vignette("dataset_df", package = "dataset") vignette.

Examples

Run this code
my_dataset <- dataset_df(
   country_name = defined(
     c("AD", "LI"),
     definition = "http://data.europa.eu/bna/c_6c2bb82d",
     namespace = "https://www.geonames.org/countries/$1/"),
   gdp = defined(
     c(3897, 7365),
     label = "Gross Domestic Product",
     unit = "million dollars",
     definition = "http://data.europa.eu/83i/aa/GDP")
)

print(my_dataset)

is.dataset_df(my_dataset)

Run the code above in your browser using DataLab