Description Usage Arguments Value Author(s) See Also Examples
View source: R/read_r2c_raster.R
This function reads a file
containing a time series of 2D values, which is output from
a MESH model. It is not intended to read in a file
describing a drainage basin. For that purpose, you should be using the
function read_r2c_shed
. This function returns eiher a raster brick
or
an rts
rts
object, which is a timeseries raster. Each Frame in the original
file becomes a separate layer.
'The name of each layer in the raster brick
is set to the
time stamp of each Frame. Because the layer names
are standard R variables, they must obey the rules for variable names,
inclusing beginning with a character, and not containing spaces. These rule
will change the layer names if you are not careful.
1 2 3 4 5 6 7 | read_r2c_raster(
r2cFile,
NAvalue = NULL,
as_rts = FALSE,
timezone = "",
layerNameFormat = NULL
)
|
r2cFile |
Required. Name of |
NAvalue |
Optional. If specified, values smaller than |
as_rts |
Optional. If |
timezone |
Optional. If the |
layerNameFormat |
Optional. Sets the layer names when returning the
raster |
Returns eiher a raster brick
or an rts
rts
object.
Kevin Shook
1 2 3 4 5 6 7 8 9 | ## Not run:
temps <- read_r2c_raster("TA_M.r2c", NAvalue = 0, as_rts = FALSE, layerNameFormat = "%b_%Y")
# convert air temps from K to C
temps <- temps - 273.15
plot(temps)
# create an animation and save it as a file
library(animation)
saveGIF(animate(temps, n = 1))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.