rawgraphs-app icon indicating copy to clipboard operation
rawgraphs-app copied to clipboard

Handling of NAs

Open drwilkins opened this issue 3 years ago • 1 comments

First off, thank you for developing this. It's a really amazing tool for exploring data visualization. I'm particularly keen to use this in the classroom (grades 5-16).

That said, in order to use realistic data sets, it would be great to have some intuitive handling of missing data. Right now, blanks seem to be interpreted as 0, and both NA (default blank output for R) or "#N/A" spit out by Excel lead to an error in data import. Ideally all 3 inputs would be interpreted as missing and simply not plotted (and paired observations removed).

Steps to reproduce this Specific example data where blanks are wrongly interpreted as 0.

Year Heterozygosity MinPopEst
1985   30
1986 0.227 28
1987 0.224 26
1988 0.217 26
1989 0.197 22
1990 0.191 29
1991 0.194 19
1992 0.189 28
1993 0.184 22
1994 0.191 24
1995 0.195 26
1996 0.184 34
1997 0.195 41
1998 0.197 49
1999 0.205 51
2000 0.208 62
2001 0.227 78
2002 0.226 80
2003 0.24 76
2004 0.244 84
2005 0.246 92
2006 0.25 94
2007 0.247 117
2008   104
2009   113
2010   115
2011   110
2012   123
2013   133

image To produce this graph, I chose "Bubble chart" with mapping X=Year, Y=Heterozygosity, Size=MinPopEst, color="MinpopEst, Label=Heterozygosity

Additional context

drwilkins avatar Jun 26 '21 19:06 drwilkins

Interesting to note @drwilkins that in my experience with BLANK, N/A, or NULL values is not just that they are improperly represented as zeros- but I'm curious if you try to sort the data by the column 'Heterozygosity' (by clicking on the word at the top of the dataset) does your entire rawgraphs app page crash like I have been finding? It ruins the entire input data and has me start from 0 which is terrible if I have yet to save the project as a .rawgraphs file. The error output by the page console log is:

react-dom.production.min.js:209 TypeError: Cannot read property 'toString' of null at DataGrid.js:325 at Array.sort () at DataGrid.js:322 at Object.fc [as useMemo] (react-dom.production.min.js:162) at t.useMemo (react.production.min.js:25) at Ke (DataGrid.js:298) at Gi (react-dom.production.min.js:153) at Rc (react-dom.production.min.js:175) at go (react-dom.production.min.js:263) at lu (react-dom.production.min.js:246) Jc @ react-dom.production.min.js:209 react-dom.production.min.js:123 Uncaught TypeError: Cannot read property 'toString' of null at DataGrid.js:325 at Array.sort () at DataGrid.js:322 at Object.fc [as useMemo] (react-dom.production.min.js:162) at t.useMemo (react.production.min.js:25) at Ke (DataGrid.js:298) at Gi (react-dom.production.min.js:153) at Rc (react-dom.production.min.js:175) at go (react-dom.production.min.js:263) at lu (react-dom.production.min.js:246)

Edit: In hindsight, this may only occur for NULL values in a STRING-VALUE column, not a numerical column, as the first line of the error is "Cannot read property 'toString' of null"

xjchrist avatar Jul 17 '21 00:07 xjchrist