| Line 1... |
Line 1... |
| 1 |
PKG <- "@PKG@"
|
1 |
PKG <- "@PKG@"
|
| 2 |
exloc <- file.path("../../../library", PKG, "R-ex")
|
2 |
exloc <- file.path("../../../../library", PKG, "R-ex")
|
| 3 |
if(!file.exists(exloc)) stop("no examples found")
|
3 |
if(!file.exists(exloc)) stop("no examples found")
|
| 4 |
list.of.files <- list.files(exloc, ".*\\.R")
|
4 |
list.of.files <- list.files(exloc, ".*\\.R")
|
| 5 |
file <- paste("check/", PKG, "-ex.R", sep="")
|
5 |
file <- paste(PKG, "-ex.R", sep="")
|
| 6 |
file.create(file)
|
6 |
file.create(file)
|
| 7 |
cat(file=file, append=T, '.ptime <- proc.time()\n')
|
7 |
cat(file=file, append=T, '.ptime <- proc.time()\n')
|
| 8 |
cat(file=file, append=T,
|
8 |
cat(file=file, append=T,
|
| 9 |
paste('postscript("check/', PKG, '-Examples.ps")\n', sep=""))
|
9 |
paste('postscript("', PKG, '-Examples.ps")\n', sep=""))
|
| 10 |
cat(file=file, append=T, '.par.postscript <- par(no.readonly = TRUE)\n')
|
10 |
cat(file=file, append=T, '.par.postscript <- par(no.readonly = TRUE)\n')
|
| 11 |
cat(file=file, append=T, 'options(contrasts = c(unordered = "contr.treatment", ordered = "contr.poly"))\n')
|
11 |
cat(file=file, append=T, 'options(contrasts = c(unordered = "contr.treatment", ordered = "contr.poly"))\n')
|
| 12 |
if(PKG != "base")
|
12 |
if(PKG != "base")
|
| 13 |
cat(file=file, append=T, paste('library(', PKG, ')', "\n"), sep="")
|
13 |
cat(file=file, append=T, paste('library(', PKG, ')', "\n"), sep="")
|
| 14 |
for(f in list.of.files) {
|
14 |
for(f in list.of.files) {
|
| 15 |
cat(file=file, append=T, '.Random.seed <- c(0,rep(7654,3)); rm(list = ls())\n')
|
15 |
cat(file=file, append=T, '.Random.seed <- c(0,rep(7654,3)); rm(list = ls())\n')
|
| 16 |
file.append(file, file.path(exloc, f))
|
16 |
file.append(file, file.path(exloc, f))
|
| 17 |
cat(file=file, append=T, 'par(.par.postscript)\n')
|
17 |
cat(file=file, append=T, 'par(.par.postscript)\n')
|
| - |
|
18 |
cat(file=file, append=T, 'options(contrasts = c(unordered="contr.treatment", ordered = "contr.poly"))\n')
|
| 18 |
}
|
19 |
}
|
| 19 |
cat(file=file, append=T, 'cat("Time elapsed: ", proc.time() - .ptime,"\\n")\n')
|
20 |
cat(file=file, append=T, 'cat("Time elapsed: ", proc.time() - .ptime,"\\n")\n')
|
| 20 |
cat(file=file, append=T, 'dev.off(); quit("no")\n')
|
21 |
cat(file=file, append=T, 'dev.off(); quit("no")\n')
|
| - |
|
22 |
|