datapackage_install: Install a data package

Description Usage Arguments Examples

Description

Install a data package

Usage

1
datapackage_install(path, load_file, full_meta = FALSE, ...)

Arguments

path

character string path to the data package directory. Can be a local directory or a URL. If a URL is given the package will be installed in the current working directory. If the file is compressed then it currently must be .zip-ped.

load_file

character string specifying the path of the data file to load into R. The correct file paths will be printed when the function runs. By default the first file in the datapackage.json path list is loaded. Note: only one file can be loaded at a time.

full_meta

logical. Wheter or not to return the full datapackage.json metadata. Note: when TRUE only the meta data is returned not the data.

...

arguments to pass to import.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
# Load a data package called gdp stored in the current working directory:
gdp_data = datapackage_install(path = 'gdp')

# Install the gdp data package from GitHub using its .zip URL
URL <- 'https://github.com/datasets/gdp/archive/master.zip'
gdp_data <- datapackage_install(path = URL)

# Install co2 data
library(dplyr)
co2_data <- "https://github.com/datasets/co2-ppm/archive/master.zip" %>%
         datapackage_install()

## End(Not run)

dpmr documentation built on May 2, 2019, 2:11 p.m.