[R] extract values from summary of function indval of the package labdsv
Rui Barradas
ruipbarradas at sapo.pt
Tue Jul 24 13:33:34 CEST 2012
Hello,
There's a general purpose way to get the members of the object returned
by summary functions. What you have tried unsuccessfully is a particular
case of that method: assign summary to a variable and see what's int it.
si <- summary(indication3)
class(si) # see the class of summary object
[1] "NULL"
Null? It returns nothing so the general purpose method doesn't work.
More on this later.
Taking a look at the package source, file indval.R, function
summary.indval shows how it is done:
round(sum(object$indcls),digits=2)
So use 'indication3' instead of 'object and get rid of round() to have
more decimals. The following should do it.
sum(indication3$indcls)
As for the value [not] returned by summary, it is recommended that it
returns something and have the print out be handled by a
print.summaryXXX method. In which case, after seeing of what class, we
could have printed the members one by one, in a loop or something similar.
Hope this helps,
Rui Barradas
Em 23-07-2012 17:03, katse escreveu:
> Hi everybody,
> I am doing Indicator species analysis using the function "indval" from the
> package "labdsv".
> For further analysis I need the values "Number of Significant Indicators"
> and "Sum of Indicator Values" that is calculated from the summary on my
> indval object.
>
> indication3<-indval(Veg,caver3,numitr=4999)
>
> summary(indication3)
> cluster indicator_value probability
> X14 1 0.9423 0.00020004
> X10 1 0.8993 0.00040008
> ...
>
> Sum of probabilities = 22.7643528705741
>
> Sum of Indicator Values = 57.55
>
> Sum of Significant Indicator Values = 17.03
>
> Number of Significant Indicators = 22
>
> Significant Indicator Distribution
>
> 1 2 3
> 10 10 2
>
> I tried to extract them using "summary(indication3)$Sum of Indicator Values"
> for example, but it doesn't work. Is there a way to get the values?
> Someone has an idea?
> Thanks
> katse
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/extract-values-from-summary-of-function-indval-of-the-package-labdsv-tp4637466.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
More information about the R-help
mailing list