nc2dataframe {climates}R Documentation

Convert Objects of Class NC to a Data.frame

Description

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

Usage

nc2dataframe(nc)

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

## 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)

[Package climates version 0.1-1.6 Index]