| Line 1... |
Line 1... |
| 1 |
PKG <- "@PKG@"
|
1 |
PKG <- "@PKG@"
|
| - |
|
2 |
RLIB <- "@RLIB@"
|
| 2 |
exloc <- file.path("../../../../library", PKG, "R-ex")
|
3 |
exloc <- file.path(RLIB, PKG, "R-ex")
|
| 3 |
if(!file.exists(exloc)) stop("no examples found")
|
4 |
if(!file.exists(exloc)) stop("no examples found")
|
| 4 |
list.of.files <- list.files(exloc, ".*\\.R")
|
5 |
list.of.files <- list.files(exloc, ".*\\.R")
|
| 5 |
file <- paste(PKG, "-Ex.R", sep="")
|
6 |
file <- paste(PKG, "-Ex.R", sep="")
|
| 6 |
file.create(file)
|
7 |
file.create(file)
|
| 7 |
cat(file=file, append=T, 'attach(NULL, name = ".CheckExEnv")\n',
|
8 |
cat(file=file, append=T, 'attach(NULL, name = ".CheckExEnv")\n',
|
| Line 12... |
Line 13... |
| 12 |
cat(file=file, append=T,
|
13 |
cat(file=file, append=T,
|
| 13 |
'assign("par.postscript", par(no.readonly = TRUE), env=.CheckExEnv)\n')
|
14 |
'assign("par.postscript", par(no.readonly = TRUE), env=.CheckExEnv)\n')
|
| 14 |
cat(file=file, append=T, 'options(contrasts = c(unordered = "contr.treatment", ordered = "contr.poly"))\n')
|
15 |
cat(file=file, append=T, 'options(contrasts = c(unordered = "contr.treatment", ordered = "contr.poly"))\n')
|
| 15 |
cat(file=file, append=T, 'options(pager="console")\n')
|
16 |
cat(file=file, append=T, 'options(pager="console")\n')
|
| 16 |
if(PKG != "base")
|
17 |
if(PKG != "base")
|
| 17 |
cat(file=file, append=T, paste('library(', PKG, ')', "\n"), sep="")
|
18 |
cat(file=file, append=T, paste('library(', PKG, ', lib.loc="', RLIB, '")', "\n", sep=""))
|
| 18 |
for(f in list.of.files) {
|
19 |
for(f in list.of.files) {
|
| 19 |
cat(file=file, append=T,
|
20 |
cat(file=file, append=T,
|
| 20 |
'rm(list = ls(all=TRUE)); .Random.seed <- c(0,rep(7654,3))\n')
|
21 |
'rm(list = ls(all=TRUE)); .Random.seed <- c(0,rep(7654,3))\n')
|
| 21 |
file.append(file, file.path(exloc, f))
|
22 |
file.append(file, file.path(exloc, f))
|
| 22 |
cat(file=file, append=T, 'par(get("par.postscript",env=.CheckExEnv))\n')
|
23 |
cat(file=file, append=T, 'par(get("par.postscript",env=.CheckExEnv))\n')
|