R : Copyright 2005, The R Foundation for Statistical Computing Version 2.1.1 (2005-06-20), ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for a HTML browser interface to help. Type 'q()' to quit R. > ### *
> ### > attach(NULL, name = "CheckExEnv") > assign(".CheckExEnv", as.environment(2), pos = length(search())) # base > ## add some hooks to label plot pages for base and grid graphics > setHook("plot.new", ".newplot.hook") > setHook("persp", ".newplot.hook") > setHook("grid.newpage", ".gridplot.hook") > > assign("cleanEx", + function(env = .GlobalEnv) { + rm(list = ls(envir = env, all.names = TRUE), envir = env) + RNGkind("default", "default") + set.seed(1) + options(warn = 1) + delayedAssign("T", stop("T used instead of TRUE"), + assign.env = .CheckExEnv) + delayedAssign("F", stop("F used instead of FALSE"), + assign.env = .CheckExEnv) + sch <- search() + newitems <- sch[! sch %in% .oldSearch] + for(item in rev(newitems)) + eval(substitute(detach(item), list(item=item))) + missitems <- .oldSearch[! .oldSearch %in% sch] + if(length(missitems)) + warning("items ", paste(missitems, collapse=", "), + " have been removed from the search path") + }, + env = .CheckExEnv) > assign("..nameEx", "__{must remake R-ex/*.R}__", env = .CheckExEnv) # for now > assign("ptime", proc.time(), env = .CheckExEnv) > grDevices::postscript("cyclones-Examples.ps") > assign("par.postscript", graphics::par(no.readonly = TRUE), env = .CheckExEnv) > options(contrasts = c(unordered = "contr.treatment", ordered = "contr.poly")) > options(warn = 1) > library('cyclones') Loading required package: ncdf Loading required package: akima Loading required package: clim.pact > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "CCI" > > ### * CCI > > flush(stderr()); flush(stdout()) > > ### Name: CCI > ### Title: Calculus Cyclone identification. > ### Aliases: CCI stopCCI > ### Keywords: manip > > ### ** Examples > > ## Not run: > ##D # Shell script for running in batch (background proccess) > ##D #! /bin/bash > ##D cat > paper20e.R << EOF > ##D library(clim.pact) > ##D library(cyclones) > ##D source("cyclones/R/cyclones.R") > ##D > ##D a<- Sys.info() > ##D dir <- switch(substr(as.character(a[4]),1,9), > ##D "saragasso"="/data1/hirham/", > ##D "stratonim"="/data1/hirham/", > ##D "virvelvin"="/home/rasmusb/data/data1/") > ##D > ##D filname.1 <- "/home/rasmusb/data/ERA40/era40_slp.nc" > ##D fname.1 <- "data/cyclones_ERA40.Rdata" > ##D vname.1 <- "msl" > ##D > ##D print("===================< ERA 15 >===================") > ##D CCI(fname="data/cyclones_ERA40_r1.Rdata",dx=1,dy=1,fielddata=filname.1, > ##D vname=vname.1,label="ERA40: slp 1-degree res.",force365.25=TRUE,lplot=FALSE) > ##D EOF > ##D > ##D nice R CMD BATCH --no-save paper20e.R paper20e.out > ## End(Not run) > > > > cleanEx(); ..nameEx <- "cyclstat" > > ### * cyclstat > > flush(stderr()); flush(stdout()) > > ### Name: cyclstat > ### Title: Cyclone statistics > ### Aliases: cyclstat > ### Keywords: manip > > ### ** Examples > > ## Not run: > ##D library(cyclones) > ##D load("data/cyclonesERA40.Rdata") > ##D results.era40 <- results > ##D > ##D europe <- cyclstat(results.era40,cmp=TRUE,x.rng=c(-10,20),y.rng=c(40,55)) > ## End(Not run) > > > > cleanEx(); ..nameEx <- "dx" > > ### * dx > > flush(stderr()); flush(stdout()) > > ### Name: dX > ### Title: First derivatives from harmonic fits. > ### Aliases: dX dY dT > ### Keywords: manip > > ### ** Examples > > # Construct a test series: > t <- seq(-3,3,by=0.1) > nt <- length(t) > y <- 2*rnorm(nt) + 10*sin(t/4) - 7*sin(t/3) + 4*cos(t) - sin(2*t) + 2*cos(3*t) + 0.5*sin(4*t) > plot(y) > > dydt <- dT(y) > lines(dydt$y.fit,col="red") > dydt.2 <- dT(y,maxhar=3) > lines(dydt.2$y.fit,col="blue",lty=2) > > # First derivative > plot(dydt$dy,type="l") > lines(dydt.2$dy,col="blue",lty=2) > > # Second derivative > dy2dt2<-dT(dydt$dy) > dy2dt2.2<-dT(dydt.2$dy) > plot(dy2dt2$dy,type="l") > lines(dy2dt2.2$dy,col="blue",lty=2) > > > > cleanEx(); ..nameEx <- "filters" > > ### * filters > > flush(stderr()); flush(stdout()) > > ### Name: filters > ### Title: Various filters. > ### Aliases: ma.filt gauss.filt binom.filt parzen.filt hanning.filt > ### welch.filt > ### Keywords: manip > > ### ** Examples > > > > > cleanEx(); ..nameEx <- "reg.cal" > > ### * reg.cal > > flush(stderr()); flush(stdout()) > > ### Name: Regression-gradients > ### Title: REGression based CALculus for empirical data > ### Aliases: coefFit coefDeriv coefInt geoGrad testReg.cal derivFFT > ### integrFFT testFFTcalc > ### Keywords: manip > > ### ** Examples > > ## Not run: > ##D # Polynomial series calculus. (testReg.cal) > ##D library(clim.pact) > ##D load("data/etopo5_scandinavia.Rdata") > ##D y <- ROSE[i.y,] > ##D a <- coefFit(y,n=N) > ##D da <- coefDeriv(a) > ##D a.2 <- coefInt(da,c1=a$coefs[1]) > ##D newFig() > ##D plot(ETOPO5X,y,type="s",lwd=3,xlab="Longitude (degE)",ylab="m.a.s.l.", > ##D main=paste("Transect: ",round(ETOPO5Y[i.y],1),"degE")) > ##D polygon(c(ETOPO5X,ETOPO5X[1320],ETOPO5X[1]), > ##D c(da$y.deriv/quantile(da$y.deriv,0.9)*quantile(y,0.7),0,0),col="blue") > ##D lines(ETOPO5X,y,type="s",lwd=4) > ##D lines(ETOPO5X,a$y.hat,col="red",lty=2,lwd=2) > ##D lines(ETOPO5X,a.2$y.int,col="steelblue",lty=1) > ##D > ##D # FFT-based calculus (testFFTcalc) > ##D > ##D x <- seq(-3,3,length=100) > ##D y <- 3*cos(5*x) + 0.3*sin(18*x) - 1.4*sin(3*x) + 0.15*sin(23*x) > ##D plot(x,y,type="l",lwd=3) > ##D grid() > ##D dydx <- deriv.fft(y) > ##D y2 <- integr.fft(dydx) > ##D lines(x,y2,col="red",lty=2,lwd=2) > ##D grid() > ##D newFig() > ##D plot(x,Im(dydx),type="l",lwd=3) > ##D grid() > ##D lines(x,rep(0,length(x)),col="grey") > ## End(Not run) > > > > cleanEx(); ..nameEx <- "storms" > > ### * storms > > flush(stderr()); flush(stdout()) > > ### Name: storms > ### Title: North Atlantic cyclone statistics. > ### Aliases: storms data(storms) > ### Keywords: datasets > > ### ** Examples > > > > > ### *