Hi there,
I'm a newbie in R, so I hope to get some tips...
I wrote a script that basically takes some csv files and calculates
the Kappa statistics for the data in each file (I used the
kappam.fleiss() function from the “irr” library).
The script works fine (after some trouble with the loop, I finally
nailed it :D). The problem is that the output format of the
kapam.fleiss function is a list, and I want to print that output into
a file. As far as I tried, neither cat() or write.table() or any
function can handle it appropriately.
Here is an example of the output:
> result<-kappam.fleiss(teste, detail=TRUE); result
Fleiss' Kappa for m Raters
Subjects = 822
Raters = 3
Kappa = 0.875
z = 43.5
p-value = 0
Kappa z p.value
# 0.875 43.460 0.000
0 0.875 43.460 0.000
I've tried to unlist, but the output comes out kinda messy:
> unlist(result)
method subjects
"Fleiss' Kappa for m Raters" "822"
raters
irr.name
"3" "Kappa"
value detail1
"0.87518077167814" "0.875"
detail2 detail3
"0.875" "43.46"
detail4 detail5
"43.46" "0"
detail6
stat.name
"0" "z"
statistic p.value
"43.4604584739041" "0"
So, does anybody knows how to send the exact output, as showed in
screen, to a txt file?