Closed monaw closed 2 weeks ago
looks like currently the code is renaming the first column to xdata and we end up with 2 xdata columns! debug statement shows the gpsdata at the end of preprocessDataframe() to contain:
xdata id time ydata
Min. : 1.0 Length:1580 Min. : 0 Min. :4224793
1st Qu.: 395.8 Class :character 1st Qu.: 19815 1st Qu.:4231487
Median : 790.5 Mode :character Median : 39720 Median :4234742
Mean : 790.5 Mean : 55348 Mean :4240917
3rd Qu.:1185.2 3rd Qu.: 72750 3rd Qu.:4252112
Max. :1580.0 Max. :209460 Max. :4258177
xdata
Min. :244694
1st Qu.:247323
Median :252713
Mean :252169
3rd Qu.:257614
Max. :259963
This is one for me to tackle. I'll address this once I'm done with the NSF annual report, probably tomorrow (7/10)
more debugging shows that loadDataframeFromFile() read.csv call will name a header "X" when the column name is blank and then that X column gets renamed to xdata by our code and hence resulting in 2 xdata columns; didn't realize R will allow duplicate column name! so perhaps the fix is not to write the column with no header...
oops, that caused a new error "Warning: Error in read.table: duplicate 'row.names' are not allowed" when loading dataset 5_bobcats_F4_F9_F13_M10_M15_BBMMinput.csv, debugging...
changing the read.csv() call broke reading other csv files NOT written by write.csv(). instead, i've changed the write.csv() call and that seems to work now
it seems when a data file is saved, it cannot be loaded back!
for example 5_bobcats_F4_F9_F13_M10_M15_BBMMinput.csv first 5 entries:
loads fine. after it is saved, the file looks like:
but the app will throw an error message "Error : Missing required columns; must have time and lat-long, x-y or UTM"