The R Project SVN R

Rev

Rev 72617 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 72617 Rev 72619
Line 1... Line 1...
1
## partly moved from ../man/smooth.spline.Rd , quite system-specific.
1
## partly moved from ../man/smooth.spline.Rd , quite system-specific.
-
 
2
if(!dev.interactive(TRUE)) pdf("smooth.spline-test.pdf")
-
 
3
 
2
##-- artificial example
4
##-- artificial example
3
y18 <- c(1:3, 5, 4, 7:3, 2*(2:5), rep(10, 4))
5
y18 <- c(1:3, 5, 4, 7:3, 2*(2:5), rep(10, 4))
4
## "truly 64 bit platform" {have seen "x86-64" instead of "x86_64")
6
## "truly 64 bit platform" {have seen "x86-64" instead of "x86_64")
5
(b.64 <- grepl("^x86.64", Sys.info()[["machine"]]) &&
7
(b.64 <- grepl("^x86.64", Sys.info()[["machine"]]) &&
6
     .Machine$sizeof.pointer > 4)## "truly 64 bit platform"
8
     .Machine$sizeof.pointer > 4)## "truly 64 bit platform"
Line 23... Line 25...
23
 
25
 
24
## This gave error: "... spar 'way too large'" -- now sees in dpbfa() that it can't factorize
26
## This gave error: "... spar 'way too large'" -- now sees in dpbfa() that it can't factorize
25
## --> and gives *warning* about too large spar only
27
## --> and gives *warning* about too large spar only
26
## e <- try(smooth.spline(y18, spar = 50)) #>> error
28
## e <- try(smooth.spline(y18, spar = 50)) #>> error
27
## stopifnot(inherits(e, "try-error"))
29
## stopifnot(inherits(e, "try-error"))
28
ss50 <- try(smooth.spline(y18, spar = 50)) #>> warning only (in R >= 3.4.0) -- ?? FIXME
30
ss50 <- try(smooth.spline(y18, spar = 50)) #>> warning only (in R >= 3.4.0) -- FIXME ??
29
   e <- try(smooth.spline(y18, spar = -9)) #>> error : .. too small'
31
   e <- try(smooth.spline(y18, spar = -9)) #>> error : .. too small', not on 32-bit
30
## if(Lb.64) stopifnot(inherits(e, "try-error"))
32
## if(Lb.64) stopifnot(inherits(e, "try-error"))
31
if(Lb.64) inherits(e, "try-error") else "not Linux 64-bit"
33
if(Lb.64) inherits(e, "try-error") else "not Linux 64-bit"
32
## I see (in 32 bit Windows),
34
## I see (in 32 bit Windows),
33
b.64 || inherits(ss50, "try-error")  # TRUE .. always?
35
b.64 || inherits(ss50, "try-error")  # TRUE .. always?
34
 
36
 
Line 69... Line 71...
69
## s2.11 is very close to 's2'
71
## s2.11 is very close to 's2'
70
 
72
 
71
if(!requireNamespace("Matrix") && !interactive())
73
if(!requireNamespace("Matrix") && !interactive())
72
    q("no")
74
    q("no")
73
 
75
 
74
if(Lb.64)## extra checks from above
76
if(Lb.64 && interactive()) ## extra checks (from above), but _not_ part of R checks
75
    stopifnot(inherits(e, "try-error"),
77
    stopifnot(inherits(e, "try-error"))
-
 
78
## in any case:
-
 
79
rbind("s-9_err" = inherits(e, "try-error"),
76
              inherits(ss50, "try-error"))
80
      "s+50_err"= inherits(ss50, "try-error"))
77
 
81
 
78
 
82
 
79
aux2Mat <- function(auxM) {
83
aux2Mat <- function(auxM) {
80
    stopifnot(is.list(auxM),
84
    stopifnot(is.list(auxM),
81
              identical(vapply(auxM, class, ""),
85
              identical(vapply(auxM, class, ""),