Re: [R] list

From: jim holtman <jholtman_at_gmail.com>
Date: Tue, 29 Jul 2008 06:06:29 -0400

Is this what you are after: this comes from the example of wilcox.test and shows the structure and how to reference the p-value:

> z <- wilcox.test(x, y, paired = TRUE, alternative = "greater")
> str(z)

List of 7
 $ statistic : Named num 40
  ..- attr(*, "names")= chr "V"

 $ parameter  : NULL
 $ p.value    : num 0.0195
 $ null.value : Named num 0
  ..- attr(*, "names")= chr "location shift"
 $ alternative: chr "greater"
 $ method     : chr "Wilcoxon signed rank test"
 $ data.name : chr "x and y"

On Tue, Jul 29, 2008 at 1:00 AM, Paul Adams <pma3622_at_yahoo.com> wrote:
> I have run a wilcox test on a dataframe and I have returned to me data which
> I am wanting to sort and/or pick the max.
> I have tried the following code to pick the max:
> v<-wilcox.test.run
> w<-max(v,na.rm=FALSE)
>
> I have also tried w<-pmax(p-value,na.rm=FALSE) for the second line
>
> and this returns the following error:invalid 'type' (list) of argument
> This error is understandable because I am trying to find the max p-value from a list of
> 100 with the following output:
>
>
> $g100
> Wilcoxon signed rank test
> data:newX[,i]
> V=741, p-value=8.051e-08
>
> I want to be able to pull only the maximum p-value from this output and the $g that matches the p-value by using max.Any help would be appreciated.
>
> Thanks
> Paul
>
>
>
>
>
> [[alternative HTML version deleted]]
>
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>

-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Tue 29 Jul 2008 - 10:13:49 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 29 Jul 2008 - 10:32:51 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive