Running ‘test_scripts.R’ [16s/20s]
Running the tests in ‘tests/test_scripts.R’ failed.
Complete output:
  > ## Note: R CMD check may run these scripts from an installed package
  > scripts <- list.files(system.file("scripts", package = "sm"), ".*\\.q$")
  > ## these are interactive
  > omit2 <- match(c("bissell3.q", "dogs.q"), scripts)
  > scripts <- scripts[-omit2]
  > library(sm)
  Package 'sm', version 2.2-5.4: type help(sm) for summary information
  > if(.Platform$OS.type == "unix") options(pager="cat") else options(pager="console")
  > postscript(file="test_scripts.ps")
  > for(z in scripts) {
  +     cat("\n============ running script `", z, "' ============\n", sep="")
  +     set.seed(123)
  +     source(system.file("scripts", z, package = "sm"), echo=TRUE)
  +     rm(list = ls(all = TRUE))
  + }
  
  ============ running script `air_band.q' ============
  
  > with(aircraft, {
  +     y <- log(Span)[Period == 3]
  +     sm.density(y, xlab = "Log span", display = "se")
  + })
  
  ============ running script `air_boot.q' ============
  
  > with(aircraft, {
  +     y <- log(Span)[Period == 3]
  +     sm.density(y, xlab = "Log span")
  +     for (i in 1:20) sm.density(sample(y, replace = TRUE) .... [TRUNCATED] 
  
  ============ running script `air_cont.q' ============
  
  > with(airpc, {
  +     pc <- cbind(Comp.1, Comp.2)
  +     pc1 <- pc[Period == 1, ]
  +     pc2 <- pc[Period == 2, ]
  +     pc3 <- pc[Period == 3, ]
  +     p .... [TRUNCATED] 
  Loading required package: rgl
  Loading required package: rpanel
  Loading required package: tcltk
  Package `rpanel', version 1.1-3: type help(rpanel) for summary information
  Loading required package: rgl
  Loading required package: rgl
  
  ============ running script `air_dens.q' ============
  
  > with(airpc, {
  +     pc3 <- cbind(Comp.1, Comp.2)[Period == 3, ]
  +     par(mfrow = c(2, 2))
  +     par(cex = 0.6)
  +     plot(pc3)
  +     sm.density(pc3 .... [TRUNCATED] 
  Loading required package: rgl
  Loading required package: rgl
  Loading required package: rgl
  
  ============ running script `air_hcv.q' ============
  
  > with(aircraft, {
  +     y <- log(Span)[Period == 3]
  +     par(mfrow = c(1, 2))
  +     sm.density(y, h = hcv(y), xlab = "Log span", lty = 3, yht = 1.4) .... [TRUNCATED] 
  Loading required package: rgl
  
  ============ running script `air_imag.q' ============
  
  > with(airpc, {
  +     pc3 <- cbind(Comp.1, Comp.2)[Period == 3, ]
  +     par(mfrow = c(1, 2))
  +     sm.density(pc3, display = "image")
  +     sm.density .... [TRUNCATED] 
  Loading required package: rgl
  Loading required package: rgl
  
  ============ running script `air_ind.q' ============
  
  > with(aircraft, {
  +     Speed3 <- log(Speed[Period == 3])
  +     Span3 <- log(Span[Period == 3])
  +     par(mfrow = c(1, 2))
  +     plot(Span3, Speed3,  .... [TRUNCATED] 
  Loading required package: rgl
  
  ============ running script `air_inds.q' ============
  
  > with(aircraft, {
  +     Speed3 <- log(Speed[Period == 3])
  +     Span3 <- log(Span[Period == 3])
  +     air3 <- cbind(Span3, Speed3)
  +     result.12 <- .... [TRUNCATED] 
  Loading required package: rgl
  Observed value:  -0.12786 
  Loading required package: rgl
  1  Loading required package: rgl
  2  Loading required package: rgl
  3  Loading required package: rgl
  4  Loading required package: rgl
  5  Loading required package: rgl
  6  Loading required package: rgl
  7  Loading required package: rgl
  8  Loading required package: rgl
  9  Loading required package: rgl
  10  Loading required package: rgl
  11  Loading required package: rgl
  12  Loading required package: rgl
  13  Loading required package: rgl
  14  Loading required package: rgl
  15  Loading required package: rgl
  16  Loading required package: rgl
  17  Loading required package: rgl
  18  Loading required package: rgl
  19  Loading required package: rgl
  20  Loading required package: rgl
  21  Loading required package: rgl
  22  Loading required package: rgl
  23  Loading required package: rgl
  24  Loading required package: rgl
  25  Loading required package: rgl
  26  Loading required package: rgl
  27  Loading required package: rgl
  28  Loading required package: rgl
  29  Loading required package: rgl
  30  Loading required package: rgl
  31  Loading required package: rgl
  32  Loading required package: rgl
  33  Loading required package: rgl
  34  Loading required package: rgl
  35  Loading required package: rgl
  36  Loading required package: rgl
  37  Loading required package: rgl
  38  Loading required package: rgl
  39  Loading required package: rgl
  40  Loading required package: rgl
  41  Loading required package: rgl
  42  Loading required package: rgl
  43  Loading required package: rgl
  44  Loading required package: rgl
  45  Loading required package: rgl
  46  Loading required package: rgl
  47  Loading required package: rgl
  48  Loading required package: rgl
  49  Loading required package: rgl
  50  Loading required package: rgl
  51  Loading required package: rgl
  52  Loading required package: rgl
  53  Loading required package: rgl
  54  Loading required package: rgl
  55  Loading required package: rgl
  56  Loading required package: rgl
  57  Loading required package: rgl
  58  Loading required package: rgl
  59  Loading required package: rgl
  60  Loading required package: rgl
  61  Loading required package: rgl
  62  Loading required package: rgl
  63  Loading required package: rgl
  64  Loading required package: rgl
  65  Loading required package: rgl
  66  Loading required package: rgl
  67  Loading required package: rgl
  68  Loading required package: rgl
  69  Loading required package: rgl
  70  Loading required package: rgl
  71  Loading required package: rgl
  72  Loading required package: rgl
  73  Loading required package: rgl
  74  Loading required package: rgl
  75  Loading required package: rgl
  76  Loading required package: rgl
  77  Loading required package: rgl
  78  Loading required package: rgl
  79  Loading required package: rgl
  80  Loading required package: rgl
  81  Loading required package: rgl
  82  Loading required package: rgl
  83  Loading required package: rgl
  84  Loading required package: rgl
  85  Loading required package: rgl
  86  Loading required package: rgl
  87  Loading required package: rgl
  88  Loading required package: rgl
  89  Loading required package: rgl
  90  Loading required package: rgl
  91  Loading required package: rgl
  92  Loading required package: rgl
  93  Loading required package: rgl
  94  Loading required package: rgl
  95  Loading required package: rgl
  96  Loading required package: rgl
  97  Loading required package: rgl
  98  Loading required package: rgl
  99  Loading required package: rgl
  100  Loading required package: rgl
  101  Loading required package: rgl
  102  Loading required package: rgl
  103  Loading required package: rgl
  104  Loading required package: rgl
  105  Loading required package: rgl
  106  Loading required package: rgl
  107  Loading required package: rgl
  108  Loading required package: rgl
  109  Loading required package: rgl
  110  Loading required package: rgl
  111  Loading required package: rgl
  112  Loading required package: rgl
  113  Loading required package: rgl
  114  Loading required package: rgl
  115  Loading required package: rgl
  116  Loading required package: rgl
  117  Loading required package: rgl
  118  Loading required package: rgl
  119  Loading required package: rgl
  120  Loading required package: rgl
  121  Loading required package: rgl
  122  Loading required package: rgl
  123  Loading required package: rgl
  124  Loading required package: rgl
  125  Loading required package: rgl
  126  Loading required package: rgl
  127  Loading required package: rgl
  128  Loading required package: rgl
  129  Loading required package: rgl
  130  Loading required package: rgl
  131  Loading required package: rgl
  132  Loading required package: rgl
  133  Loading required package: rgl
  134  Loading required package: rgl
  135  Loading required package: rgl
  136  Loading required package: rgl
  137  Loading required package: rgl
  138  Loading required package: rgl
  139  Loading required package: rgl
  140  Loading required package: rgl
  141  Loading required package: rgl
  142  Loading required package: rgl
  143  Loading required package: rgl
  144  Loading required package: rgl
  145  Loading required package: rgl
  146  Loading required package: rgl
  147  Loading required package: rgl
  148  Loading required package: rgl
  149  Loading required package: rgl
  150  Loading required package: rgl
  151  Loading required package: rgl
  152  Loading required package: rgl
  153  Loading required package: rgl
  154  Loading required package: rgl
  155  Loading required package: rgl
  156  Loading required package: rgl
  157  Loading required package: rgl
  158  Loading required package: rgl
  159  Loading required package: rgl
  160  Loading required package: rgl
  161  Loading required package: rgl
  162  Loading required package: rgl
  163  Loading required package: rgl
  164  Loading required package: rgl
  165  Loading required package: rgl
  166  Loading required package: rgl
  167  Loading required package: rgl
  168  Loading required package: rgl
  169  Loading required package: rgl
  170  Loading required package: rgl
  171  Loading required package: rgl
  172  Loading required package: rgl
  173  Loading required package: rgl
  174  Loading required package: rgl
  175  Loading required package: rgl
  176  Loading required package: rgl
  177  Loading required package: rgl
  178  Loading required package: rgl
  179  Loading required package: rgl
  180  Loading required package: rgl
  181  Loading required package: rgl
  182  Loading required package: rgl
  183  Loading required package: rgl
  184  Loading required package: rgl
  185  Loading required package: rgl
  186  Loading required package: rgl
  187  Loading required package: rgl
  188  Loading required package: rgl
  189  Loading required package: rgl
  190  Loading required package: rgl
  191  Loading required package: rgl
  192  Loading required package: rgl
  193  Loading required package: rgl
  194  Loading required package: rgl
  195  Loading required package: rgl
  196  Loading required package: rgl
  197  Loading required package: rgl
  198  Loading required package: rgl
  199  Loading required package: rgl
  200  Empirical significance: 1 
  
  ============ running script `air_scat.q' ============
  
  > with(airpc, {
  +     pc <- cbind(Comp.1, Comp.2)
  +     pc1 <- pc[Period == 1, ]
  +     pc2 <- pc[Period == 2, ]
  +     pc3 <- pc[Period == 3, ]
  +     x .... [TRUNCATED] 
  
  ============ running script `bin_use.q' ============
  
  > cat("Examples of use of function binning()\n")
  Examples of use of function binning()
  
  > x <- rnorm(1000)
  
  > xb <- binning(x)
  
  > h <- hnorm(x)
  
  > sm.density(xb$x, h = h, weights = xb$x.freq, ylim = c(0, 
  +     0.5/sqrt(var(x))))
  
  > pause()
  
  > x <- cbind(x, x + rnorm(1000))
  
  > xb <- binning(x)
  
  > h <- hnorm(x)
  
  > par(mfrow = c(1, 2))
  
  > sm.density(xb$x, h = h, weights = xb$x.freq)
  Loading required package: rgl
  
  > sm.density(xb$x, h = h, weights = xb$x.freq, display = "slice")
  Loading required package: rgl
  
  > par(mfrow = c(1, 1))
  
  > pause()
  
  > with(airpc, {
  +     pc3 <- cbind(Comp.1, Comp.2)[Period == 3, ]
  +     pc.bin <- binning(pc3)
  +     par(mfrow = c(1, 2))
  +     sm.density(pc.bin$x, h .... [TRUNCATED] 
  Loading required package: rgl
  this time original data rather than grid data are plotted
  Loading required package: rgl
  
  ============ running script `birth1.q' ============
  
  > with(birth, {
  +     Low1 <- Low[Smoke == "S"]
  +     Lwt1 <- Lwt[Smoke == "S"]
  +     Lj <- jitter(Low1, amount = 0)
  +     plot(Lwt1, Lj, type = "n",  .... [TRUNCATED] 
  
  ============ running script `birth2.q' ============
  
  > with(birth, {
  +     Low0 <- Low[Smoke == "N"]
  +     Lwt0 <- Lwt[Smoke == "N"]
  +     Low1 <- Low[Smoke == "S"]
  +     Lwt1 <- Lwt[Smoke == "S"]
  +      .... [TRUNCATED] 
  
  ============ running script `bissell1.q' ============
  
  > with(bissell, {
  +     plot(Length, Flaws, xlim = c(0, 1000), pch = "o")
  +     beta <- sum(Flaws)/sum(Length)
  +     x <- seq(0, 1000, length = 50)
  +  .... [TRUNCATED] 
  
  ============ running script `bissell2.q' ============
  
  > with(bissell, {
  +     plot(Length, Flaws, xlim = c(0, 1000), pch = "o")
  +     beta <- sum(Flaws)/sum(Length)
  +     x <- seq(0, 1000, length = 50)
  +  .... [TRUNCATED] 
  
  ============ running script `citrate.q' ============
  
  > with(citrate, {
  +     Citrate <- as.matrix(citrate)
  +     nSubj <- dim(Citrate)[1]
  +     nTime <- dim(Citrate)[2]
  +     Time <- (1:nTime)
  +     plot .... [TRUNCATED] 
  Autocovariances & autocorrelations:
       auto-cov  auto-corr
  0  360.623571 1.00000000
  1  244.287143 0.67740204
  2  204.040714 0.56579972
  3  175.807857 0.48751072
  4  151.130000 0.41907965
  5  128.680714 0.35682835
  6  120.196429 0.33330164
  7  103.723571 0.28762283
  8   91.565000 0.25390742
  9   87.847857 0.24359988
  10  53.901429 0.14946729
  11  22.932143 0.06359025
  12  13.760714 0.03815811
  13   9.732143 0.02698698
         Rice's criterion:
         h    indept.   depend.
  [1] 0.100000 6.005194 6.005194
  [1] 0.200000 6.005156 6.005182
  [1] 0.300000 5.965648 5.992517
  [1] 0.400000 5.583011 5.878175
  [1] 0.500000 4.855846 5.702201
  [1] 0.600000 4.131101 5.579386
  [1] 0.700000 3.535247 5.519406
  [1] 0.800000 3.072755 5.506906
  [1] 0.900000 2.735846 5.530976
  [1] 1.000000 2.516341 5.582579
  [1] 1.100000 2.400934 5.653475
  [1] 1.200000 2.370399 5.736703
  [1] 1.300000 2.402966 5.826924
  [1] 1.400000 2.478570 5.920349
  [1] 1.500000 2.581237 6.014418
  [1] 1.600000 2.699336 6.107412
  [1] 1.700000 2.824778 6.198149
  [1] 1.800000 2.952046 6.285777
  [1] 1.900000 3.077424 6.369671
  [1] 2.000000 3.198465 6.449387
  h:  0.8 
  
  ============ running script `edfgrad.q' ============
  
  > with(aircraft, {
  +     y <- log(Span[Period == 3])
  +     n <- length(y)
  +     plot(sort(y), (1:n)/n, type = "S", xlab = "y", ylab = "Empirical distr ..." ... [TRUNCATED] 
  
  ============ running script `follicle.q' ============
  
  > with(follicle, {
  +     sm.regression(Age, log(Count), h = 4, lty = 2)
  +     model <- loess(log(Count) ~ Age)
  +     lines(Age, model$fitted, col = 6) .... [TRUNCATED] 
  
  ============ running script `geys3d.q' ============
  
  > with(geys3d, {
  +     par(mfrow = c(1, 2))
  +     plot(Waiting, Duration)
  +     sm.density(geys3d)
  +     par(mfrow = c(1, 1))
  + })
  Loading required package: rgl
  Loading required package: misc3d
  at least one of the rpanel, rgl or misc3d packages  is not available.
  
  ============ running script `geys_ts.q' ============
  
  > d <- geyser$duration
  
  > cat("Data are: d=(duration of geyser eruption)\n")
  Data are: d=(duration of geyser eruption)
  
  > cat("Marginal density of d(t) first, followed by\n")
  Marginal density of d(t) first, followed by
  
  > cat("estimated density of (d(t-k),d(t)), for k=1,2\n")
  estimated density of (d(t-k),d(t)), for k=1,2
  
  > a <- sm.ts.pdf(d, lags = c(1, 2))
  Loading required package: rgl
  Loading required package: rgl
  
  ============ running script `lc_comp.q' ============
  
  > with(lcancer, {
  +     cases <- cbind(Easting/10000, Northing/10000)[Cancer == 1, 
  +         ]
  +     controls <- cbind(Easting/10000, Northing/10000) .... [TRUNCATED] 
  Loading required package: rgl
  Loading required package: rgl
  Observed value: 384.6738 
  Loading required package: rgl
  Loading required package: rgl
  1  Loading required package: rgl
  Loading required package: rgl
  2  Loading required package: rgl
  Loading required package: rgl
  3  Loading required package: rgl
  Loading required package: rgl
  4  Loading required package: rgl
  Loading required package: rgl
  5  Loading required package: rgl
  Loading required package: rgl
  6  Loading required package: rgl
  Loading required package: rgl
  7  Loading required package: rgl
  Loading required package: rgl
  8  Loading required package: rgl
  Loading required package: rgl
  9  Loading required package: rgl
  Loading required package: rgl
  10  Loading required package: rgl
  Loading required package: rgl
  11  Loading required package: rgl
  Loading required package: rgl
  12  Loading required package: rgl
  Loading required package: rgl
  13  Loading required package: rgl
  Loading required package: rgl
  14  Loading required package: rgl
  Loading required package: rgl
  15  Loading required package: rgl
  Loading required package: rgl
  16  Loading required package: rgl
  Loading required package: rgl
  17  Loading required package: rgl
  Loading required package: rgl
  18  Loading required package: rgl
  Loading required package: rgl
  19  Loading required package: rgl
  Loading required package: rgl
  20  
  p-value =  0.75 
  
  ============ running script `lc_dens.q' ============
  
  > with(lcancer, {
  +     cases <- cbind(Easting, Northing)[Cancer == 1, ]/10000
  +     controls <- cbind(Easting, Northing)[Cancer == 2, ]/10000
  +     x .... [TRUNCATED] 
  Loading required package: rgl
  Loading required package: rgl
  
  ============ running script `lc_rr.q' ============
  
  > with(lcancer, {
  +     cases <- cbind(Easting, Northing)[Cancer == 1, ]/10000
  +     controls <- cbind(Easting, Northing)[Cancer == 2, ]/10000
  +     x .... [TRUNCATED] 
  Loading required package: rgl
  Loading required package: rgl
  
  ============ running script `lynx.q' ============
  
  > ts.plot(lynx)
  
  > title("Canadian lynx trapping (1821-1934)")
  
  > pause()
  
  > cat("Data are now log-transformed\n")
  Data are now log-transformed
  
  > log.lynx <- log(lynx)
  
  > sm.ts.pdf(log.lynx, lags = 4:5)
  Loading required package: rgl
  Loading required package: rgl
  
  > pause()
  
  > sm.autoregression(log.lynx, maxlag = 5, se = TRUE)
  
  > pause()
  
  > sm.autoregression(log.lynx, lags = cbind(4, 5))
  
  ============ running script `mackgam.q' ============
  
  > library(gam)
  Loading required package: splines
  Loading required package: foreach
  Loaded gam 1.15
  
  
  > model1 <- gam(log(Density) ~ lo(log(mack.depth)) + 
  +     lo(Temperature) + lo(mack.lat, mack.long), data = mackerel)
  
  > print(model1)
  Call:
  gam(formula = log(Density) ~ lo(log(mack.depth)) + lo(Temperature) + 
      lo(mack.lat, mack.long), data = mackerel)
  
  Degrees of Freedom: 278 total; 262.7774 Residual
  Residual Deviance: 260.3544 
  
  > print(gam(log(Density) ~ lo(Temperature) + lo(mack.lat, 
  +     mack.long), data = mackerel))
  Call:
  gam(formula = log(Density) ~ lo(Temperature) + lo(mack.lat, mack.long), 
      data = mackerel)
  
  Degrees of Freedom: 278 total; 266.4857 Residual
  Residual Deviance: 359.4476 
  
  > print(gam(log(Density) ~ lo(log(mack.depth)) + lo(mack.lat, 
  +     mack.long), data = mackerel))
  Call:
  gam(formula = log(Density) ~ lo(log(mack.depth)) + lo(mack.lat, 
      mack.long), data = mackerel)
  
  Degrees of Freedom: 278 total; 266.0766 Residual
  Residual Deviance: 271.311 
  
  > print(gam(log(Density) ~ lo(log(mack.depth)) + lo(Temperature), 
  +     data = mackerel))
  Call:
  gam(formula = log(Density) ~ lo(log(mack.depth)) + lo(Temperature), 
      data = mackerel)
  
  Degrees of Freedom: 278 total; 270.9924 Residual
  Residual Deviance: 335.5316 
  
  > par(mfrow = c(2, 2))
  
  > plot.gam(model1, se = TRUE)
  Error in plot.gam(model1, se = TRUE) : could not find function "plot.gam"
  Calls: source -> withVisible -> eval -> eval
  In addition: There were 50 or more warnings (use warnings() to see the first 50)
  Execution halted