1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
|
## For examples skipped in testing because they are 'random'
set.seed(1)
if(.Platform$OS.type == "windows") options(pager = "console")
pdf("reg-examples-1.pdf", encoding = "ISOLatin1.enc")
## base
example(Cstack_info)
example(DateTimeClasses)
example(Dates)
example(Ops.Date)
example(Random)
example(Sys.getpid)
example(Sys.sleep)
example(Sys.time)
example(as.POSIXlt)
example(difftime)
example(format.Date)
example(Reduce) # funprog.Rd
example(gc)
example(memory.profile)
paste("Today is", date()) # from paste.Rd
trunc(Sys.time(), "day") # from round.POSIXt.Rd
example(srcref)
example(strptime)
example(sys.parent)
example(system.time)
example(tempfile)
example(weekdays)
library(help="splines")
## for example(NA)
if(require("microbenchmark")) {
x <- c(NaN, 1:10000)
print(microbenchmark(any(is.na(x)), anyNA(x)))
} else { ## much less accurate
x <- c(NaN, 1e6)
nSim <- 2^13
print(rbind(is.na = system.time(replicate(nSim, any(is.na(x)))),
anyNA = system.time(replicate(nSim, anyNA(x)))))
}
## utils
example(news)
example(sessionInfo)
## datasets
example(JohnsonJohnson)
example(ability.cov)
example(npk)
## grDevices
if(.Platform$OS.type == "windows") {
example(windowsFonts)
} else {
example(X11Fonts)
example(quartzFonts)
}
library(tools)
example(Rdutils)
example(fileutils)
## results are location- and OS-specific
example(parseLatex) # charset-specific
## part of example(buildVignettes) at one time
gVigns <- pkgVignettes("grid")
str(gVigns) # contains paths
vind <- system.file(package = "grid", "doc", "index.html")
if(nzchar(vind)) { # so vignettes have been installed
`%=f=%` <- function(a, b) normalizePath(a) == normalizePath(b)
with(gVigns,
stopifnot(engines == "utils::Sweave",
pkgdir %=f=% system.file(package="grid"),
dir %=f=% system.file(package = "grid", "doc"),
(n. <- length(docs)) >= 12, # have 13
n. == length(names), n. == length(engines),
length(msg) == 0) ) # as it is a 'base' package
stopifnot("grid" %in% gVigns$names, inherits(gVigns, "pkgVignettes"))
}
proc.time()
|