Forum: help


RE: Getting the counts straight (re. NA handling) [ Reply ] By: Marc Lijour on 2011-08-12 18:08 | [forum:4840] |
Thanks for the good work on this package. Suggestions: 1) either discard the NA values in the table, or print a warning on screen. 2) print a summary of the values used as part of the computation (it would make it obvious that NA values have been used). I can't imaging a case for which NA values should be counted, but I am just a newbie. |
RE: Getting the counts straight (re. NA handling) [ Reply ] By: Jonathan Swinton on 2011-08-11 14:38 | [forum:4837] |
I like bugs that fix themselves like this...but I think Vennerable could be smarter even so. Will have a think about this next time I come back to it, suggestions welcome. Thanks for your interest in Vennerable |
RE: Getting the counts straight (re. NA handling) [ Reply ] By: Marc Lijour on 2011-08-04 07:08 | [forum:4783] |
OK got it. NA have no business in the data frame. For the record: > test2 <- lapply(test, na.omit) > venn <- Venn(test2) > venn A Venn object on 3 sets named GT,DM,PA 000 100 010 110 001 101 011 111 0 1 1 1 1 1 0 1 > plot(venn, show = list(Faces=FALSE)) |
RE: Getting the counts straight (re. NA handling) [ Reply ] By: Marc Lijour on 2011-08-04 06:42 | [forum:4782] |
Here is the CSV file (upload does not work): GT,DM,PA a,a,a b,, ,c, ,,d e,,e f,f, |
Getting the counts straight (re. NA handling) [ Reply ] By: Marc Lijour on 2011-08-04 06:40 | [forum:4781] |
I am new here, but this does not seem right (other than that, the package is amazing by the way). The common intersection of 3 sets (111) is counting one too many items. Apparently this is due to the way it handling NA? I am using this correctly? See the attached CSV for a test. > test <- read.csv("test.csv", na.strings="") > test GT DM PA 1 a a a 2 b <NA> <NA> 3 <NA> c <NA> 4 <NA> <NA> d 5 e <NA> e 6 f f <NA> > venn <- Venn(test) > venn A Venn object on 3 sets named GT,DM,PA 000 100 010 110 001 101 011 111 0 1 1 1 1 1 0 2 > str(venn) Formal class 'Venn' [package "Vennerable"] with 2 slots ..@ IndicatorWeight : int [1:8, 1:4] 0 1 0 1 0 1 0 1 0 0 ... .. ..- attr(*, "dimnames")=List of 2 .. .. ..$ : chr [1:8] "000" "100" "010" "110" ... .. .. ..$ : chr [1:4] "GT" "DM" "PA" ".Weight" ..@ IntersectionSets:List of 8 .. ..$ 000: NULL .. ..$ 100: chr "b" .. ..$ 010: chr "c" .. ..$ 110: chr "f" .. ..$ 001: chr "d" .. ..$ 101: chr "e" .. ..$ 011: NULL .. ..$ 111: chr [1:2] "a" NA Look at the last line: what is NA doing there? It is not even common to all three factors! Thanks for reading this. |