as.numeric() (and its siblings) strip the names from vectors, e.g.:

> as.numeric(t.test(rnorm(1001))$statistic)
[1] -0.6320304
>

hth,

Tony Plate

At Friday 05:14 PM 4/16/2004, christopher ciotti wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello all -


I'm trying to format some data where I only need one of the values returned from a test, say a t-test in this instance. I have the following:


> R.version.string
[1] "R version 1.9.0, 2004-04-12"
> x <- rnorm(1001)
> t.test(x)$statistic
       t
0.5555321
>

Any easy way (other than straight calculation) to get the t-statistic w/o the 't' above it? TIA

- --
chris ciotti ([EMAIL PROTECTED])
PGP ID: 0xE94BB3B7


-----BEGIN PGP SIGNATURE----- Version: PGP 8.0

iQA/AwUBQIBotlkgIqbpS7O3EQIt7ACdEhhoM3tqqmDae71Rdo/eHg2TvoQAoLSw
8QjwkHENOjjs5mzCWlXSTQXO
=LvW5
-----END PGP SIGNATURE-----

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to