The R Project SVN R

Rev

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

Rev 77335 Rev 77431
Line 1... Line 1...
1
 
1
 
2
R Under development (unstable) (2019-10-26 r77334) -- "Unsuffered Consequences"
2
R Under development (unstable) (2019-11-17 r77430) -- "Unsuffered Consequences"
3
Copyright (C) 2019 The R Foundation for Statistical Computing
3
Copyright (C) 2019 The R Foundation for Statistical Computing
4
Platform: x86_64-pc-linux-gnu (64-bit)
4
Platform: x86_64-pc-linux-gnu (64-bit)
5
 
5
 
6
R is free software and comes with ABSOLUTELY NO WARRANTY.
6
R is free software and comes with ABSOLUTELY NO WARRANTY.
7
You are welcome to redistribute it under certain conditions.
7
You are welcome to redistribute it under certain conditions.
Line 3920... Line 3920...
3920
> 
3920
> 
3921
> ### ** Examples
3921
> ### ** Examples
3922
> 
3922
> 
3923
> asOneSidedFormula("age")
3923
> asOneSidedFormula("age")
3924
~age
3924
~age
3925
<environment: 0x50cda00>
3925
<environment: 0x4d267b0>
3926
> asOneSidedFormula(~ age)
3926
> asOneSidedFormula(~ age)
3927
~age
3927
~age
3928
> 
3928
> 
3929
> 
3929
> 
3930
> 
3930
> 
Line 4957... Line 4957...
4957
    r <- V
4957
    r <- V
4958
    r[] <- Is * V * rep(Is, each = p)
4958
    r[] <- Is * V * rep(Is, each = p)
4959
    r[cbind(1L:p, 1L:p)] <- 1
4959
    r[cbind(1L:p, 1L:p)] <- 1
4960
    r
4960
    r
4961
}
4961
}
4962
<bytecode: 0x5ea7a08>
4962
<bytecode: 0x5b42118>
4963
<environment: namespace:stats>
4963
<environment: namespace:stats>
4964
> stopifnot(all.equal(Cl, cov2cor(cov(longley))),
4964
> stopifnot(all.equal(Cl, cov2cor(cov(longley))),
4965
+           all.equal(cor(longley, method = "kendall"),
4965
+           all.equal(cor(longley, method = "kendall"),
4966
+             cov2cor(cov(longley, method = "kendall"))))
4966
+             cov2cor(cov(longley, method = "kendall"))))
4967
> 
4967
> 
Line 7581... Line 7581...
7581
> environment(fo)
7581
> environment(fo)
7582
<environment: R_GlobalEnv>
7582
<environment: R_GlobalEnv>
7583
> environment(as.formula("y ~ x"))
7583
> environment(as.formula("y ~ x"))
7584
<environment: R_GlobalEnv>
7584
<environment: R_GlobalEnv>
7585
> environment(as.formula("y ~ x", env = new.env()))
7585
> environment(as.formula("y ~ x", env = new.env()))
7586
<environment: 0x5a5eb78>
7586
<environment: 0x56d64e8>
7587
> 
7587
> 
7588
> 
7588
> 
7589
> ## Create a formula for a model with a large number of variables:
7589
> ## Create a formula for a model with a large number of variables:
7590
> xnam <- paste0("x", 1:25)
7590
> xnam <- paste0("x", 1:25)
7591
> (fmla <- as.formula(paste("y ~ ", paste(xnam, collapse= "+"))))
7591
> (fmla <- as.formula(paste("y ~ ", paste(xnam, collapse= "+"))))
Line 12275... Line 12275...
12275
[1] "link-glm"
12275
[1] "link-glm"
12276
> quasi(link = power(1/3))[c("linkfun", "linkinv")]
12276
> quasi(link = power(1/3))[c("linkfun", "linkinv")]
12277
$linkfun
12277
$linkfun
12278
function (mu) 
12278
function (mu) 
12279
mu^lambda
12279
mu^lambda
12280
<bytecode: 0x4f058c8>
12280
<bytecode: 0x4d87e90>
12281
<environment: 0x4f0fa50>
12281
<environment: 0x4d92718>
12282
 
12282
 
12283
$linkinv
12283
$linkinv
12284
function (eta) 
12284
function (eta) 
12285
pmax(eta^(1/lambda), .Machine$double.eps)
12285
pmax(eta^(1/lambda), .Machine$double.eps)
12286
<bytecode: 0x4f05778>
12286
<bytecode: 0x4d87d40>
12287
<environment: 0x4f0fa50>
12287
<environment: 0x4d92718>
12288
 
12288
 
12289
> 
12289
> 
12290
> 
12290
> 
12291
> 
12291
> 
12292
> cleanEx()
12292
> cleanEx()
Line 16491... Line 16491...
16491
> 
16491
> 
16492
> ## look at the internal structure:
16492
> ## look at the internal structure:
16493
> unclass(sfun0)
16493
> unclass(sfun0)
16494
function (v) 
16494
function (v) 
16495
.approxfun(x, y, v, method, yleft, yright, f, na.rm)
16495
.approxfun(x, y, v, method, yleft, yright, f, na.rm)
16496
<bytecode: 0x43441a0>
16496
<bytecode: 0x3f07870>
16497
<environment: 0x5e5d9f8>
16497
<environment: 0x33066c0>
16498
attr(,"call")
16498
attr(,"call")
16499
stepfun(1:3, y0, f = 0)
16499
stepfun(1:3, y0, f = 0)
16500
> ls(envir = environment(sfun0))
16500
> ls(envir = environment(sfun0))
16501
[1] "f"      "method" "na.rm"  "x"      "y"      "yleft"  "yright"
16501
[1] "f"      "method" "na.rm"  "x"      "y"      "yleft"  "yright"
16502
> 
16502
> 
Line 18872... Line 18872...
18872
> ### * <FOOTER>
18872
> ### * <FOOTER>
18873
> ###
18873
> ###
18874
> cleanEx()
18874
> cleanEx()
18875
> options(digits = 7L)
18875
> options(digits = 7L)
18876
> base::cat("Time elapsed: ", proc.time() - base::get("ptime", pos = 'CheckExEnv'),"\n")
18876
> base::cat("Time elapsed: ", proc.time() - base::get("ptime", pos = 'CheckExEnv'),"\n")
18877
Time elapsed:  6.429 0.201 6.661 0 0 
18877
Time elapsed:  6.543 0.202 6.819 0 0 
18878
> grDevices::dev.off()
18878
> grDevices::dev.off()
18879
null device 
18879
null device 
18880
          1 
18880
          1 
18881
> ###
18881
> ###
18882
> ### Local variables: ***
18882
> ### Local variables: ***