as_dpkg {dpkg} | R Documentation |
Use a data.frame and metadata to create a data package
Description
Convert a data frame into a data package (dpkg
) by providing specific metadata in the arguments.
Usage
as_dpkg(
x,
name = deparse(substitute(x)),
version = "0.0.0.9000",
title = character(),
homepage = character(),
description = character()
)
Arguments
x |
a tibble or data frame |
name |
a lowercase character string consisting of only
|
version |
a character string representing a semantic version (e.g., "0.2.1") |
title |
a character string that is a title of the data package for humans |
homepage |
a valid URL that links to a webpage with code or descriptions related to creation of the data package |
description |
a character string (markdown encouraged!) of more details about how the data was created, including the data sources, references to code or packages used, relevant details for any specific columns, and notes about (mis)usage of the data |
Details
name
should be specified, but if is not will be deparsed from code defining x
;
this might not result in a valid name
(e.g., when piping code to create a data frame)
Value
a dpkg object
Examples
x <- as_dpkg(mtcars, name = "mtcars", title = "Motor Trend Road Car Tests")
attr(x, "description") <- "This is a data set all about characteristics of different cars"
attr(x, "homepage") <- "https://github.com/cole-brokamp/dpkg"
x