Skip to content
Prev 301039 / 398503 Next

extract values from summary of function indval of the package labdsv

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: