nc2dataframe: Convert Objects of Class NC to a Data.frame

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

convert the anomoly work to a dataframe with xyz where the z columns are the different time values

Usage

1

Arguments

nc

~~Describe nc here~~

Details

input is a object from append.nc or extract.monthly.averages or retrieve.nc

Value

...

Note

~~further notes~~

Author(s)

~~who you are~~

References

~put references to the literature/web site here ~

See Also

~~objects to See Also as help, ~~~

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (nc) {
	#ensure nc is from retrieve.nc or similar
	if (all(c('dat','tim','lat', 'lon') %in% names(nc))==FALSE)
  stop('nc must have objects named dat, lat, lon and tim as from
  retrieve.nc of clim.pact package, append.nc or extract.monthly.averages')
	#do the work
	out = expand.grid(lon = nc$lon,lat = nc$lat)
	for (tim in nc$tim) out[[paste('tim.',tim,sep='')]] = as.vector(nc$dat[tim,,])
	return(out)
  }
  
## End(Not run)

jjvanderwal/climates documentation built on May 19, 2019, 11:41 a.m.