The task is simple but I do something wrong. I use package sjmisc, and the function frq (frequency table). I would like to get acces to column: valid.prc and store it as a variable (last part is easy, but the initial one makes trouble, i.e. a$valid.prc doesn't work and result is NULL).
Sample data:
a <- sample(seq(from =1, to =7),size = 100,replace = T)
frequencytable <- frq(a)
How to extract data from column valid.prc? Many thanks for help.
frequencytable
is a list, use [[
to subset list so that you have a dataframe and then extract column valid.prc
as usual
class(frequencytable)
#[1] "sjmisc_frq" "list"
frequencytable[[1]]$valid.prc
#[1] 17 11 14 19 15 11 13 NA