| dataset_df | R Documentation |
dataset_df objectThe dataset_df() constructor creates semantically rich modern data frames.
These inherit from tibble::tibble and carry structured metadata using
attributes.
dataset_df(
...,
identifier = c(obs = "http://example.com/dataset#obs"),
var_labels = NULL,
units = NULL,
concepts = NULL,
dataset_bibentry = NULL,
dataset_subject = NULL
)
as_dataset_df(
df,
identifier = c(obs = "http://example.com/dataset#obs"),
var_labels = NULL,
units = NULL,
concepts = NULL,
dataset_bibentry = NULL,
dataset_subject = NULL,
...
)
is.dataset_df(x)
## S3 method for class 'dataset_df'
print(x, ...)
is_dataset_df(x)
... |
Vectors (columns) that should be included in the dataset. |
identifier |
A named vector of one or more URI prefixes for row IDs.
Defaults to |
var_labels |
A named list of human-readable labels for each variable. |
units |
A named list of measurement units for measured variables. |
concepts |
A named list of linked concepts (URIs) for variables or dimensions. |
dataset_bibentry |
A bibliographic metadata record for the dataset,
created using |
dataset_subject |
A subject descriptor created with |
df |
A |
x |
A |
Use is.dataset_df() to check class membership.
S3 methods for dataset_df include:
print() to display the dataset with metadata
summary() to summarize both data and metadata
For full details, see vignette("dataset_df", package = "dataset").
A dataset_df object: a tibble with attached metadata stored in
attributes.
is.dataset_df returns a logical value
(if the object is of class dataset_df.)
A simple, serverless scaffolding for publishing dataset_df objects
on the web (with HTML + RDF exports) is available at
https://github.com/dataobservatory-eu/dataset-template.
defined(), dublincore(), datacite(), subject()
my_dataset <- dataset_df(
country_name = defined(
c("AD", "LI"),
concept = "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",
concept = "http://data.europa.eu/83i/aa/GDP"
),
identifier = c(
obs = "https://dataobservatory-eu.github.io/dataset-template#"
),
dataset_bibentry = dublincore(
title = "GDP of Andorra and Liechtenstein",
description = "A small but semantically rich dataset example.",
creator = person("Jane", "Doe", role = "cre"),
publisher = "Open Data Institute",
language = "en"
)
)
# Basic usage
print(my_dataset)
head(my_dataset)
summary(my_dataset)
# Metadata access
as_dublincore(my_dataset)
as_datacite(my_dataset)
# Export description as RDF triples
my_description <- describe(my_dataset, con = tempfile())
my_description
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.