ohi.read.csv: Ocean Health Index: Data file format

Description Usage Arguments Value See Also Examples

Description

Simple read/write utility functions for the CSV and RData data file format.

Usage

1
ohi.read.csv(file, na.strings = "", row.names = NULL, ...)

Arguments

file

Full path to input/output file.

x

A data frame with data to write.

digits

Use to restrict ASCII representation of doubles.

row.names

Do not use them by default

na.strings

Use blanks for NA.

na

Use blanks for NA.

dir

The directory to use.

method

The data file format method.

envir

Environment in which to assign name

name

The variable to which data will be assigned, and used for the filename – e.g., name = 'regions' will look for 'regions.csv', etc.

xdim

The name of a dimension, and expects get(dimension) to return a valid data frame with 2 columns: region_code, and dimension – e.g., ('region_code', 'status').

...

Arguments passed onto read.csv, write.csv, load, save.

Value

Returns a data.frame with the input data.

See Also

read.csv, write.csv

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
  d <- ohi.read.csv('data/regions.csv')
  names(d)
  head(d)

  d$label <- toupper(d$label)
  ohi.write.csv(d, 'data/regions.veryloud.csv')

  status <- data.frame(region_code=d$region_code, status=rnorm(nrow(d)))
  ohi.save.status()

## End(Not run)

bbest/ohigui documentation built on May 11, 2019, 9:25 p.m.