WayneGitShell / GWSDAT

GroundWater Spatiotemporal Data Analysis Tool (GWSDAT) R-Shiny implementation.
https://stats-glasgow.shinyapps.io/GWSDAT
31 stars 7 forks source link

Data import (csv), warning when replacing NA values in DF$Result #167

Open andrejadd opened 7 years ago

andrejadd commented 7 years ago

Happens with the Basic Data at the end of readConcData()

Warning in [<-.factor(*tmp*, is.na(DF$Result), value = 0) : ungültiges Faktorniveau, NA erzeug

DF$Result[is.na(DF$Result)] <- 0

If an "ND" string was found in DF$Result, it becomes automatically a factor and this is when the error happens. Since the basic example contains "ND<.." elements, it will trigger but do no harm because no NA fields exists.

Fix this anyway to make the warning disappear.

Long way: filter out "ND" , convert to numeric, then make the check.