Running ‘test_scripts.R’ [17s/23s]
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
  
  ============ 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] 
  
  ============ 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] 
  
  ============ 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] 
  
  ============ 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] 
  
  ============ running script `air_inds.q' ============
  
  > with(aircraft, {
  +     Speed3 <- log(Speed[Period == 3])
  +     Span3 <- log(Span[Period == 3])
  +     air3 <- cbind(Span3, Speed3)
  +     result.12 <- .... [TRUNCATED] 
  Observed value:  -0.12786 
  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  86  87  88  89  90  91  92  93  94  95  96  97  98  99  100  101  102  103  104  105  106  107  108  109  110  111  112  113  114  115  116  117  118  119  120  121  122  123  124  125  126  127  128  129  130  131  132  133  134  135  136  137  138  139  140  141  142  143  144  145  146  147  148  149  150  151  152  153  154  155  156  157  158  159  160  161  162  163  164  165  166  167  168  169  170  171  172  173  174  175  176  177  178  179  180  181  182  183  184  185  186  187  188  189  190  191  192  193  194  195  196  197  198  199  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)
  
  > sm.density(xb$x, h = h, weights = xb$x.freq, display = "slice")
  
  > 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] 
  this time original data rather than grid data are plotted
  
  ============ 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: misc3d
  
  ============ 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))
  
  ============ running script `lc_comp.q' ============
  
  > with(lcancer, {
  +     cases <- cbind(Easting/10000, Northing/10000)[Cancer == 1, 
  +         ]
  +     controls <- cbind(Easting/10000, Northing/10000) .... [TRUNCATED] 
  Observed value: 384.6738 
  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  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] 
  
  ============ running script `lc_rr.q' ============
  
  > with(lcancer, {
  +     cases <- cbind(Easting, Northing)[Cancer == 1, ]/10000
  +     controls <- cbind(Easting, Northing)[Cancer == 2, ]/10000
  +     x .... [TRUNCATED] 
  
  ============ 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)
  
  > 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
  Execution halted