Learn R Programming

eva3dm (version 0.99.1)

rast_to_netcdf: Function to convert/save a SpatRaster array/Netcdf

Description

Conversion of SpatRaster to array and optionally save on a Netcdf File.

Usage

rast_to_netcdf(r, file, name, unit = units(r), XY = FALSE, verbose = TRUE)

Value

numerical array

Arguments

r

SpatRaster object

file

Netcdf file name

name

variable name on a Netcdf file

unit

unit of the variable (set to NA to don't change unit)

XY

set to true if MemoryOrder is XY (only if file is missing)

verbose

display additional information

Examples

Run this code
folder   <- system.file("extdata",package="eva3dm")
wrf_file <- paste0(folder,"/wrf.day1.o3.nc")

Rast     <- wrf_rast(wrf_file,'o3')
A        <- rast_to_netcdf(Rast)

Run the code above in your browser using DataLab