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("udunits-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('udunits') > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "print.utDate" > > ### * print.utDate > > flush(stderr()); flush(stdout()) > > ### Name: print.utDate > ### Title: Print a Formatted Calendar Date > ### Aliases: print.utDate > ### Keywords: utilities > > ### ** Examples > > # Make a 'utDate' object by hand. This class of object is also > # returned by function 'utCalendar()' > date <- list() > class(date) <- "utDate" > date$year <- 1990 > date$month <- 6 > date$day <- 15 > date$hour <- 12 > date$minute <- 30 > date$second <- 10.0 > > print(date) # default format is "full" [1] "1990/06/15 12:30" > > # Turn the date into a character string without printing it > s <- print(date,format="unix",quiet=TRUE) > > print(paste("here is that date one more time:",s)) [1] "here is that date one more time: Fri Jun 15 12:30 1990" > > # Note that if you want a formatted date INSIDE a paste call, you > # have to call print with quiet=TRUE, like this: > print(paste("Yet another way of formatting the date:",print(date,format="sci",quiet=TRUE))) [1] "Yet another way of formatting the date: 15 Jun 1990" > > > > cleanEx(); ..nameEx <- "utCalendar" > > ### * utCalendar > > flush(stderr()); flush(stdout()) udunits(3): Couldn't open units database "/Users/jago/udunits-1.12.4/etc/udunits.dat": No such file or directory utInit (R version): error: units file not found! Set environmental variable UDUNITS_PATH to the fully qualified filename of the udunits units file (usually named udunits.dat, often found in /usr/local/lib) > > ### Name: utCalendar > ### Title: Convert Temporal Amounts to Calendar Date > ### Aliases: utCalendar > ### Keywords: utilities > > ### ** Examples > > # Initialize the udunits library > utInit() Error in utInit() : Error in utInit Execution halted