I could not find / think of a direct method, so I just created my own. I retrieve the last column of the data frame, i.e. Pr(>F)
p = a[[1]][,5]
flushes the last value from this space:
p = p[-length(p)]
then worked out the encoding:
stars = findInterval(p, c(0, 0.001, 0.01, 0.05, 0.1,)) codes = c("***" , "**","*", ".", " ") codes[stars]
You can, of course, put this in a function if you want.
get_stars = function(p) { stars = findInterval(p, c(0, 0.001, 0.01, 0.05, 0.1)) codes = c("***" , "**","*", ".", " ") codes[stars] }
Example
R> p = c(0.0005, 0.005, 0.025, 0.075, 0.5) R> get_stars(p) [1] "***" "**" "*" "." " "