[R] printing all htest class members

Rui Barradas ruipbarradas at sapo.pt
Thu Dec 15 21:12:19 CET 2011


Hello,

Once again, and as simple as possible,

res <- data.frame(ord=2:4, df=2:4, Q=c(0.0129, 0.049, 0.0684),
                    p=c(0.9936, 0.9972, 0.9994))

ht2<-structure(
    list(statistic=c(Q=res$Q[1]),
        p.value=res$p[1],
        parameter=c(df=res$df[1]),
        alternative="It doesn't print 'all.orders'",
        method="Test the 'print.htest' method",
        data.name=deparse(substitute(x)),
        null.value=res      # this is printed
        #all.orders=res     # this wouldn't be if uncommented
    ),
    .Names=c("statistic","p.value","parameter","alternative",
            "method","data.name","null.value"),
    class="htest"
)
ht2
class(ht2)

Creation? Conversation in my head? Have you heard about the experimental
method?
It's a very usefull device created by one Galileo Galilei some time ago.


--
View this message in context: http://r.789695.n4.nabble.com/printing-all-htest-class-members-tp4200872p4201793.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list