readData: Ensure data is on the local file system

Description Usage Arguments Details Value

View source: R/readData.R

Description

This function should be called from the generic, readData(). Reads data from a file into R format. If you just want the filepath so you can do it yourself, specify "customReader: filepath" in the viz.yaml

readData.character is the standard entry point; from here, viz.id gets assigned a class to route it to a more specific reader

readData.viz reads contents represented by vizlab object

readData.tabular reads a text file.

readData.yaml reads a yaml file.

readData.excel reads the first spreadsheet of an Excel file.

readData.RDS reads an R object saved as an RDS.

readData.filepath returns the file path or null if location is not set

readData.parameter returns the file path or null if location is not set

readData.folder returns names of files inside a folder

readData.txt returns contents of file as character

Can either be a single markdown file, specified with mimetype: text/markdown or markdown contained in yaml with mimetype: text/yaml

readData.inline reads data directly from inline yaml

readData.json reads json files

assumes only one .shp file in zip folder

readData.svg_map reads svg

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
readData(viz)

## S3 method for class 'character'
readData(viz)

## S3 method for class 'viz'
readData(viz)

## S3 method for class 'tabular'
readData(viz)

## S3 method for class 'yaml'
readData(viz)

## S3 method for class 'excel'
readData(viz)

## S3 method for class 'rds'
readData(viz)

## S3 method for class 'filepath'
readData(viz)

## S3 method for class 'parameter'
readData(viz)

## S3 method for class 'folder'
readData(viz)

## S3 method for class 'txt'
readData(viz)

## S3 method for class 'md'
readData(viz)

## S3 method for class 'inline'
readData(viz)

## S3 method for class 'json'
readData(viz)

## S3 method for class 'shp'
readData(viz)

## S3 method for class 'svg'
readData(viz)

Arguments

viz

vizlab object or identifier

Details

If simple markdown is used, return will be the rendered html, otherwise it will be a list of html fragments named with the keys from the yaml.

Value

single value or list of values


USGS-VIZLAB/vizlab documentation built on Oct. 5, 2018, 6:20 p.m.