The R Project SVN R

Rev

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

Rev 71308 Rev 71359
Line 1... Line 1...
1
 
1
 
2
R Under development (unstable) (2016-09-16 r71269) -- "Unsuffered Consequences"
2
R Under development (unstable) (2016-09-25 r71353) -- "Unsuffered Consequences"
3
Copyright (C) 2016 The R Foundation for Statistical Computing
3
Copyright (C) 2016 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 3795... Line 3795...
3795
> 
3795
> 
3796
> ### ** Examples
3796
> ### ** Examples
3797
> 
3797
> 
3798
> asOneSidedFormula("age")
3798
> asOneSidedFormula("age")
3799
~age
3799
~age
3800
<environment: 0x4b72748>
3800
<environment: 0x35bd6a8>
3801
> asOneSidedFormula(~ age)
3801
> asOneSidedFormula(~ age)
3802
~age
3802
~age
3803
> 
3803
> 
3804
> 
3804
> 
3805
> 
3805
> 
Line 4780... Line 4780...
4780
    r <- V
4780
    r <- V
4781
    r[] <- Is * V * rep(Is, each = p)
4781
    r[] <- Is * V * rep(Is, each = p)
4782
    r[cbind(1L:p, 1L:p)] <- 1
4782
    r[cbind(1L:p, 1L:p)] <- 1
4783
    r
4783
    r
4784
}
4784
}
4785
<bytecode: 0x3e90150>
4785
<bytecode: 0x4cb8e00>
4786
<environment: namespace:stats>
4786
<environment: namespace:stats>
4787
> stopifnot(all.equal(Cl, cov2cor(cov(longley))),
4787
> stopifnot(all.equal(Cl, cov2cor(cov(longley))),
4788
+           all.equal(cor(longley, method = "kendall"),
4788
+           all.equal(cor(longley, method = "kendall"),
4789
+             cov2cor(cov(longley, method = "kendall"))))
4789
+             cov2cor(cov(longley, method = "kendall"))))
4790
> 
4790
> 
Line 6868... Line 6868...
6868
 $ linkinv   :function (eta)  
6868
 $ linkinv   :function (eta)  
6869
 $ variance  :function (mu)  
6869
 $ variance  :function (mu)  
6870
 $ dev.resids:function (y, mu, wt)  
6870
 $ dev.resids:function (y, mu, wt)  
6871
 $ aic       :function (y, n, mu, wt, dev)  
6871
 $ aic       :function (y, n, mu, wt, dev)  
6872
 $ mu.eta    :function (eta)  
6872
 $ mu.eta    :function (eta)  
6873
 $ initialize:  expression({  n <- rep.int(1, nobs)  if (is.null(etastart) && is.null(start) && is.null(mustart) && ((family$lin"| __truncated__
6873
 $ initialize:  expression({  n <- rep.int(1, nobs)  if (is.null(etastart) && is.null(start) && is.null(mustart) && ((family$link| __truncated__
6874
 $ validmu   :function (mu)  
6874
 $ validmu   :function (mu)  
6875
 $ valideta  :function (eta)  
6875
 $ valideta  :function (eta)  
6876
 - attr(*, "class")= chr "family"
6876
 - attr(*, "class")= chr "family"
6877
> 
6877
> 
6878
> gf <- Gamma()
6878
> gf <- Gamma()
Line 6889... Line 6889...
6889
 $ linkinv   :function (eta)  
6889
 $ linkinv   :function (eta)  
6890
 $ variance  :function (mu)  
6890
 $ variance  :function (mu)  
6891
 $ dev.resids:function (y, mu, wt)  
6891
 $ dev.resids:function (y, mu, wt)  
6892
 $ aic       :function (y, n, mu, wt, dev)  
6892
 $ aic       :function (y, n, mu, wt, dev)  
6893
 $ mu.eta    :function (eta)  
6893
 $ mu.eta    :function (eta)  
6894
 $ initialize:  expression({  if (any(y <= 0))  stop("non-positive values not allowed for the 'gamma' family")  n <- rep.int(1, "| __truncated__
6894
 $ initialize:  expression({  if (any(y <= 0))  stop("non-positive values not allowed for the 'gamma' family")  n <- rep.int(1, n| __truncated__
6895
 $ validmu   :function (mu)  
6895
 $ validmu   :function (mu)  
6896
 $ valideta  :function (eta)  
6896
 $ valideta  :function (eta)  
6897
 $ simulate  :function (object, nsim)  
6897
 $ simulate  :function (object, nsim)  
6898
 - attr(*, "class")= chr "family"
6898
 - attr(*, "class")= chr "family"
6899
> gf$linkinv
6899
> gf$linkinv
Line 7310... Line 7310...
7310
> environment(fo)
7310
> environment(fo)
7311
<environment: R_GlobalEnv>
7311
<environment: R_GlobalEnv>
7312
> environment(as.formula("y ~ x"))
7312
> environment(as.formula("y ~ x"))
7313
<environment: R_GlobalEnv>
7313
<environment: R_GlobalEnv>
7314
> environment(as.formula("y ~ x", env = new.env()))
7314
> environment(as.formula("y ~ x", env = new.env()))
7315
<environment: 0x3f5a360>
7315
<environment: 0x467c158>
7316
> 
7316
> 
7317
> 
7317
> 
7318
> ## Create a formula for a model with a large number of variables:
7318
> ## Create a formula for a model with a large number of variables:
7319
> xnam <- paste0("x", 1:25)
7319
> xnam <- paste0("x", 1:25)
7320
> (fmla <- as.formula(paste("y ~ ", paste(xnam, collapse= "+"))))
7320
> (fmla <- as.formula(paste("y ~ ", paste(xnam, collapse= "+"))))
Line 11920... Line 11920...
11920
[1] "link-glm"
11920
[1] "link-glm"
11921
> quasi(link = power(1/3))[c("linkfun", "linkinv")]
11921
> quasi(link = power(1/3))[c("linkfun", "linkinv")]
11922
$linkfun
11922
$linkfun
11923
function (mu) 
11923
function (mu) 
11924
mu^lambda
11924
mu^lambda
11925
<bytecode: 0x6a34f58>
11925
<bytecode: 0x3981fe0>
11926
<environment: 0x6a4a308>
11926
<environment: 0x37bff58>
11927
 
11927
 
11928
$linkinv
11928
$linkinv
11929
function (eta) 
11929
function (eta) 
11930
pmax(eta^(1/lambda), .Machine$double.eps)
11930
pmax(eta^(1/lambda), .Machine$double.eps)
11931
<bytecode: 0x6a34e40>
11931
<bytecode: 0x39820f8>
11932
<environment: 0x6a4a308>
11932
<environment: 0x37bff58>
11933
 
11933
 
11934
> 
11934
> 
11935
> 
11935
> 
11936
> 
11936
> 
11937
> cleanEx()
11937
> cleanEx()
Line 15971... Line 15971...
15971
> 
15971
> 
15972
> ## look at the internal structure:
15972
> ## look at the internal structure:
15973
> unclass(sfun0)
15973
> unclass(sfun0)
15974
function (v) 
15974
function (v) 
15975
.approxfun(x, y, v, method, yleft, yright, f)
15975
.approxfun(x, y, v, method, yleft, yright, f)
15976
<bytecode: 0x3ef7350>
15976
<bytecode: 0x4558b58>
15977
<environment: 0x530e0b0>
15977
<environment: 0x3a7f438>
15978
attr(,"call")
15978
attr(,"call")
15979
stepfun(1:3, y0, f = 0)
15979
stepfun(1:3, y0, f = 0)
15980
> ls(envir = environment(sfun0))
15980
> ls(envir = environment(sfun0))
15981
[1] "f"      "method" "x"      "y"      "yleft"  "yright"
15981
[1] "f"      "method" "x"      "y"      "yleft"  "yright"
15982
> 
15982
> 
Line 18249... Line 18249...
18249
> base::options(contrasts = c(unordered = "contr.treatment",ordered = "contr.poly"))
18249
> base::options(contrasts = c(unordered = "contr.treatment",ordered = "contr.poly"))
18250
> ### * <FOOTER>
18250
> ### * <FOOTER>
18251
> ###
18251
> ###
18252
> options(digits = 7L)
18252
> options(digits = 7L)
18253
> base::cat("Time elapsed: ", proc.time() - base::get("ptime", pos = 'CheckExEnv'),"\n")
18253
> base::cat("Time elapsed: ", proc.time() - base::get("ptime", pos = 'CheckExEnv'),"\n")
18254
Time elapsed:  4.519 0.094 4.611 0 0 
18254
Time elapsed:  8.377 0.2 8.601 0 0 
18255
> grDevices::dev.off()
18255
> grDevices::dev.off()
18256
null device 
18256
null device 
18257
          1 
18257
          1 
18258
> ###
18258
> ###
18259
> ### Local variables: ***
18259
> ### Local variables: ***