as.field.default: Coerce input to a 'field' object

View source: R/as.field.R

as.field.defaultR Documentation

Coerce input to a field object

Description

Transform an input object into the esd class field. The function first transforms the input object x into a zoo object (zoo(x, order.by=index)) and then applies as.field.zoo to obtain a field object.)

Usage

## Default S3 method:
as.field(
  x,
  ...,
  index,
  lon,
  lat,
  param,
  unit,
  longname = NA,
  quality = NA,
  src = NA,
  url = NA,
  reference = NA,
  info = NA,
  calendar = "gregorian",
  greenwich = TRUE,
  method = NA,
  type = NA,
  aspect = NA,
  verbose = FALSE
)

Arguments

x

the input object

...

other input arguments

lon

longitude(s), a numerical or numerical vector

lat

latitudes(s), a numerical or numerical vector

param

short name of variable

unit

unit of variable, e.g., 't2m'

longname

long name of variable, e.g, 'temperature at 2m'

quality

quality flag

src

source of data

url

url to website where data can be downloaded

reference

reference describing data set

info

additional information

calendar

calendar type

greenwich

a boolean; if TRUE center map on the Greenwich line (0E)

method

method applied to data

type

type of data

aspect

aspect describing data, e.g., 'original', 'anomaly', 'climatology'

verbose

a boolean; if TRUE print information about progress

time

index

Value

a field object

See Also

as.field as.field.zoo zoo

Examples

# how to generate a new field object.
year <- sort(rep(1991:2000,12))
month <- rep(1:12,length(1991:2000))
n <-length(year)
lon <- seq(-30,40,by=5); nx <- length(lon)
lat <- seq(40,70,by=5); ny <- length(lat)
# Time dimension should come first, space second.
y <- matrix(rnorm(nx*ny*n),n,nx*ny)
index <- as.Date(paste(year,month,1,sep="-"))
Y <- as.field(y,index=index,lon=lon,lat=lat,param="noise",unit="none")
map(Y)


metno/esd documentation built on April 24, 2024, 9:19 p.m.