Skip to content

Summarizing levels for future commands

1 message · Suzanne E. Blatt

#
Hello,

Thanks to those who have been responding to my query.

I've done the following, and get the following results:

table(x)

"elm.american" "hawthorn" "ironwood"
    2                1        4

which.max(table(x))

"3"

The first 'table' is fine, the 'which.max' part not.  Can I get it to actually use "ironwood", or is numeric all I can hope for?  I tried putting 'as.character' in front of the 'which.max' command but that didn't work.  The 'names(tbl)[match(max(tbl), tbl)]' also didn't work for me, claims it didn't know what the 'names' function was.

Any further suggestions most welcome,

Suzanne