refToRaster: stream.table

Description Usage Arguments Value Examples

View source: R/util.R

Description

Returns a "generator function" that can be called repeatedly, yielding lines from the file (fname). Returns 0 rows when the file has been completely read.

Usage

1
refToRaster(timeseries, year = 1970, variable = "gwno")

Arguments

timeseries

The data frame contained in the timeseries version of PrioGrid

year

The desired year. Currently only yields a single raster for a single year.

variable

A vector of variable[s] to return in a stack

filename

File name

chunksize

Number of lines in each chunk

...

Arguments passed to read.table Old grid to raster

Converts the .csv PrioGrid v.1 into a raster. Useful for testing equivalency.

Value

A raster stack with rasters for each variable

Examples

1
2
3
prioTimeseries <- read.csv('timeseries.csv') 
prioStack <- refToRaster(prioTimeseries, year = 1993, variable = 'gwno')
plot(prioStack)

prio-data/priogrid documentation built on June 28, 2021, 5:34 a.m.