knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

metadatar

Travis build status lifecycle

The goal of metadatar is to help produce minimum metadata files to document datasets in simple formats that can form building blocks of more complex metadata formats (eg. EML, rdf).

Installation

You can install the developent version of metadatar from GitHub with:

#install.packages("devtools")
devtools::install_github("annakrystalli/metadatar")

Example

This is a basic example which shows you how to create a metadata table for the gapminder dataset

library(gapminder)
library(metadatar)
str(gapminder)
meta_shell <- mt_create_meta_shell(gapminder)
knitr::kable(meta_shell)

I've focused on recognized column headers to make it easier to create an EML object down the line and on the core columns required but additional ones can be added.

Attributes associated with all variables:


columnClasses dependant attributes

Complete metadata table

meta_df <- readr::read_csv(system.file("extdata", "gapminder_meta.csv", package="metadatar"))
knitr::kable(meta_df)

Extracting factors

mt_extract_factors_tbl(meta_df)

Data visualisation utilities

Create more descriptive variable labels for plot axes/titles or tables

mt_label(meta_df, var = "gdpPercap")

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.



annakrystalli/metadatar documentation built on May 14, 2019, 6:09 a.m.