Rev 12010 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
R : Copyright 2000, The R Development Core TeamVersion 1.2.0 Patched (2000-12-30)R is free software and comes with ABSOLUTELY NO WARRANTY.You are welcome to redistribute it under certain conditions.Type `license()' or `licence()' for distribution details.R is a collaborative project with many contributors.Type `contributors()' for more information.Type `demo()' for some demos, `help()' for on-line help, or`help.start()' for a HTML browser interface to help.Type `q()' to quit R.> ### Regression tests for which the printed output is the issue>> ## PR 715 (Printing list elements w/attributes)> ##> l <- list(a=10)> attr(l$a, "xx") <- 23> l$a[1] 10attr(,"xx")[1] 23> ## Comments:> ## should print as> # $a:> # [1] 10> # attr($a, "xx"):> # [1] 23>> ## On the other hand> m <- matrix(c(1, 2, 3, 0, 10, NA), 3, 2)> na.omit(m)[,1] [,2][1,] 1 0[2,] 2 10attr(,"na.action")[1] 3attr(,"na.action")attr(,"class")[1] "omit"> ## should print as> # [,1] [,2]> # [1,] 1 0> # [2,] 2 10> # attr(,"na.action")> # [1] 3> # attr(,"na.action")attr(,"class")> # [1] "omit">> ## and> x <- 1> attr(x, "foo") <- list(a="a")> x[1] 1attr(,"foo")attr(,"foo")$a[1] "a"> ## should print as> # [1] 1> # attr(,"foo")> # attr(,"foo")$a> # [1] "a">>> ## PR 746 (printing of lists)> ##> test.list <- list(A = list(formula=Y~X, subset=TRUE),+ B = list(formula=Y~X, subset=TRUE))>> test.list$A$A$formulaY ~ X$A$subset[1] TRUE$B$B$formulaY ~ X$B$subset[1] TRUE> ## Comments:> ## should print as> # $A> # $A$formula> # Y ~ X> #> # $A$subset> # [1] TRUE> #> #> # $B> # $B$formula> # Y ~ X> #> # $B$subset> # [1] TRUE>