fetch_data: Fetch Data from AARNET Cloudstor, OneDrive, Sharepoint,...

Description Usage Arguments Value Examples

View source: R/fetch_data.R

Description

Given a URL that resolves to a downloadable data file, fetch_data() will attempt to download and import the data.

Usage

1

Arguments

url

User provided url generated by "sharing" the file via any of the supported filetypes of rio::import(), also works with raw GitHub or any other provider from which a raw data file can be downloaded and imported. Character.

which

User provided spreadhseet for '.xslx', 'Google Sheets' and '.ods' files either as the number of the sheet in order or the name of the sheet. For .Rdata objects it can be an object name. See rio::import() for further details

file_ext

Optional user provided file type extension. If provided, fetch_data() will attempt to use this as instruction about the file type being imported, e.g. "xlsx" or "csv". If not provided, fetch_data() will do its best to determine the file type automagically and import the file. Character.

Value

A ‘data.frame“ of data derived from any ’.csv', '.xls(x)', '.txt', or '.ods' file provided that R can import

Examples

1
2
3
4
# Fetch a .Rda file from GitHub
P_sojae <-
  fetch_data(url = "https://github.com/openplantpathology/hagis/blob/master/data/P_sojae_survey.rda?raw=true")
summary(P_sojae)

adamhsparks/usq.scp documentation built on Feb. 8, 2020, 5 a.m.