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("RadioSonde-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('RadioSonde') > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "ExampleSonde" > > ### * ExampleSonde > > flush(stderr()); flush(stdout()) > > ### Name: ExampleSonde > ### Title: Example Sonde/Balloon/Profiler Data > ### Aliases: ExampleSonde > ### Keywords: datasets > > ### ** Examples > > filename <- system.file("exampleData", "ExampleSonde.txt", package = "RadioSonde") > sample.sonde <- getsonde(filename) > > > > cleanEx(); ..nameEx <- "PWV" > > ### * PWV > > flush(stderr()); flush(stdout()) > > ### Name: PWV > ### Title: Precipitable Water Vapor > ### Aliases: PWV > ### Keywords: manip > > ### ** Examples > > # Example 1 > filename <- system.file("exampleData", "ExampleSonde.txt", package = "RadioSonde") > sample.sonde <- getsonde(filename) > > ###### > # OK, now find precipitable water vapor. > > PWV( sample.sonde) [1] 56.20123 > > > > > cleanEx(); ..nameEx <- "getsonde" > > ### * getsonde > > flush(stderr()); flush(stdout()) > > ### Name: getsonde > ### Title: read a radiosonde file to an R dataframe. > ### Aliases: getsonde > ### Keywords: manip > > ### ** Examples > > # Read a typical radiosonde (ASCII) datafile, headers and all. > # The datakey,varkey,and unitkey arguments come from examining > # the datafile. The whitespace is important. > > filename <- system.file("exampleData", "ExampleSonde.txt", package = "RadioSonde") > datakey <- "------" > varkey <- " Time" > unitkey <- " sec" > sample.sonde <- getsonde(filename,datakey,varkey,unitkey) > attr(sample.sonde,"units") [1] "sec" "mb" "C" "C" "%" "m/s" "m/s" "m/s" "deg" "m/s" "deg" "deg" [13] "km" "deg" "m" "mb" "C" "%" "m/s" "m/s" "m/s" > attr(sample.sonde,"metadata") [1] "Data Type: CLASS 10 SECOND DATA" [2] "Project ID: TOGA/COARE: KAVIENG" [3] "Launch Site Type/Site ID: FIXED, KAV" [4] "Launch Location (lon,lat,alt): 150 48.00E, 02 35.00S, 150.8, -2.58333, 3" [5] "GMT Launch Time (y,m,d,h,m,s): 1993, 01, 17, 17:12:16" [6] "Sonde Type/ID/Sensor ID/Tx Freq: VAISALA RS80-15N 0, 0, 400.525" [7] "Met Processor/Met Smoothing: NCAR RS80 PROCESSOR, 10 SECONDS" [8] "Winds Type/Processor/Smoothing: OMEGA, TRIMBLE MINI-OMEGA, 240 SECONDS" [9] "Pre-launch Met Obs Source: CAMPBELL SCIENTIFIC CR10" [10] "System Operator/Comments: KUSUNAN SULUSUL, (REPROCESSED),NONE" [11] "/" [12] "/" [13] " Time Press Temp Dewpt RH Uwind Vwind Wspd Dir dZ Lon Lat Rng Az Alt Qp Qt Qh Qu Qv Quv" [14] " sec mb C C % m/s m/s m/s deg m/s deg deg km deg m mb C % m/s m/s m/s" [15] "------ ------ ----- ----- ----- ------ ------ ----- ----- ----- -------- ------- ----- ----- ------- ---- ---- ---- ---- ---- ----" > plotsonde(sample.sonde,title=filename) > # > # Read the same radiosonde dataset, but ignore the units ... > # > datakey <- "------" > varkey <- " Time" > sample.sonde <- getsonde(filename,datakey,varkey) > attr(sample.sonde,"metadata") [1] "Data Type: CLASS 10 SECOND DATA" [2] "Project ID: TOGA/COARE: KAVIENG" [3] "Launch Site Type/Site ID: FIXED, KAV" [4] "Launch Location (lon,lat,alt): 150 48.00E, 02 35.00S, 150.8, -2.58333, 3" [5] "GMT Launch Time (y,m,d,h,m,s): 1993, 01, 17, 17:12:16" [6] "Sonde Type/ID/Sensor ID/Tx Freq: VAISALA RS80-15N 0, 0, 400.525" [7] "Met Processor/Met Smoothing: NCAR RS80 PROCESSOR, 10 SECONDS" [8] "Winds Type/Processor/Smoothing: OMEGA, TRIMBLE MINI-OMEGA, 240 SECONDS" [9] "Pre-launch Met Obs Source: CAMPBELL SCIENTIFIC CR10" [10] "System Operator/Comments: KUSUNAN SULUSUL, (REPROCESSED),NONE" [11] "/" [12] "/" [13] " Time Press Temp Dewpt RH Uwind Vwind Wspd Dir dZ Lon Lat Rng Az Alt Qp Qt Qh Qu Qv Quv" [14] " sec mb C C % m/s m/s m/s deg m/s deg deg km deg m mb C % m/s m/s m/s" [15] "------ ------ ----- ----- ----- ------ ------ ----- ----- ----- -------- ------- ----- ----- ------- ---- ---- ---- ---- ---- ----" > > > > cleanEx(); ..nameEx <- "plotsonde" > > ### * plotsonde > > flush(stderr()); flush(stdout()) > > ### Name: plotsonde > ### Title: Creates a SKEW-T, log p diagram for a radiosonde dataframe. > ### Aliases: plotsonde > ### Keywords: hplot aplot > > ### ** Examples > > # Example 1 > filename <- system.file("exampleData", "ExampleSonde.txt", package = "RadioSonde") > sample.sonde <- getsonde(filename) > plotsonde(sample.sonde) > > > > cleanEx(); ..nameEx <- "plotwind" > > ### * plotwind > > flush(stderr()); flush(stdout()) > > ### Name: plotwind > ### Title: Winds Profile Plot > ### Aliases: plotwind > ### Keywords: hplot > > ### ** Examples > > # Example 1: > filename <- system.file("exampleData", "ExampleSonde.txt", package = "RadioSonde") > sample.sonde <- getsonde(filename) > plotwind(sample.sonde) > # Example 2: > plotwind(sample.sonde, size = 7, legend=TRUE) > > > > cleanEx(); ..nameEx <- "skewt.axis" > > ### * skewt.axis > > flush(stderr()); flush(stdout()) > > ### Name: skewt.axis > ### Title: Draws a SKEW-T, log p axis. > ### Aliases: skewt.axis > ### Keywords: hplot > > ### ** Examples > > # draw a background, then > # draw the temperature (with a solid line) in color 6 > # draw the dewpoint in color 7 > # overlay the temperature observations in a different color > # you get the point ... > # > filename <- system.file("exampleData", "ExampleSonde.txt", package = "RadioSonde") > sample.sonde <- getsonde(filename) > skewt.axis( mar=c(5.1, 1.1, 2.1, 5.1) ) > skewt.lines( sample.sonde$temp, sample.sonde$press, col = 6) > skewt.lines( sample.sonde$dewpt, sample.sonde$press, col = 7) > skewt.points(sample.sonde$temp, sample.sonde$press, col = 3) > skewt.points(sample.sonde$dewpt, sample.sonde$press, col = 4) > # > # Changing the moist adiabats: you must edit the this-is-escaped-code{ function > # directly and then capture the output in this-is-escaped-codenormal-bracket36bracket-normal to be used in > # subsequent calls. > skewt.data <- skewt.axis(redo=TRUE) > skewt.axis() > skewt.axis() > > > > cleanEx(); ..nameEx <- "skewt.lines" > > ### * skewt.lines > > flush(stderr()); flush(stdout()) > > ### Name: skewt.lines > ### Title: Overlays data on a SKEW-T, log p axis > ### Aliases: skewt.lines > ### Keywords: aplot > > ### ** Examples > > # draw a background, then > # draw the temperature (with a solid line) in color 6 > # draw the dewpoint in color 7 > # overlay the temperature observations in a different color > # you get the point ... > > filename <- system.file("exampleData", "ExampleSonde.txt", package = "RadioSonde") > print(filename) [1] "/CRANPkg/check/RadioSonde.Rcheck/RadioSonde/exampleData/ExampleSonde.txt" > sample.sonde <- getsonde(filename) > skewt.axis() > skewt.lines( sample.sonde$temp, sample.sonde$press, col = 6) > skewt.lines( sample.sonde$dewpt, sample.sonde$press, col = 7) > skewt.points(sample.sonde$temp, sample.sonde$press, col = 3) > skewt.points(sample.sonde$dewpt, sample.sonde$press, col = 4) > > > > cleanEx(); ..nameEx <- "skewt.points" > > ### * skewt.points > > flush(stderr()); flush(stdout()) > > ### Name: skewt.points > ### Title: Overlays data on a SKEW-T, log p axis > ### Aliases: skewt.points > ### Keywords: aplot > > ### ** Examples > > # draw a background, then > # draw the temperature (with a solid line) in color 6 > # draw the dewpoint in color 7 > # overlay the temperature observations in a different color > # you get the point ... > > filename <- system.file("exampleData", "ExampleSonde.txt", package = "RadioSonde") > sample.sonde <- getsonde(filename) > skewt.axis() > skewt.lines( sample.sonde$temp, sample.sonde$press, col = 6) > skewt.lines( sample.sonde$dewpt, sample.sonde$press, col = 7) > skewt.points(sample.sonde$temp, sample.sonde$press, col = 3) > skewt.points(sample.sonde$dewpt, sample.sonde$press, col = 4) > > > > cleanEx(); ..nameEx <- "station.symbol" > > ### * station.symbol > > flush(stderr()); flush(stdout()) > > ### Name: station.symbol > ### Title: Adds a meteorological surface station annotation to a plot. > ### Aliases: station.symbol > ### Keywords: aplot > > ### ** Examples > > plot(0:1, 0:1, type="n") > station.symbol(0.5, 0.5, direction=75, speed=30, fill=3, + temp=31, press=987, dewpt=26) > > > > ### *