NEONScience / NEON-utilities

Utilities and scripts for working with NEON data. Currently: an R package with functions to join (stack) the month-by-site files in downloaded NEON data, to convert data to geoCSV format, and to download data from the API.
GNU Affero General Public License v3.0
57 stars 36 forks source link

stackByTable() failure on some sensors #100

Closed cklunch closed 4 years ago

cklunch commented 4 years ago

Function stackByTable()

Describe the bug Data stacking fails with message Error in data.table::rbindlist(pbapply::pblapply(as.list(uniqueSites), : Class attribute on column 6 of item 3 does not match with column 6 of item 1. or similar.

To Reproduce DP1.20016.001 when downloaded for all sites; other data products affected as well.

Expected behavior Data stacking should proceed as usual.

cklunch commented 4 years ago

This is happening due to inconsistencies when data.table.fread() reads in sensor_positions files for sensor locations that have moved - the end dates are read in as a mix of date, character, and logical. data.table::rbindlist() then refuses to stack them, since the classes don't match.

Fixed on GitHub (v1.3.7). If using version 1.3.6, this problem can be avoided by only stacking data from one site at a time.

Will close issue when 1.3.7 goes to CRAN.

@kcawley

cklunch commented 4 years ago

@kcawley This is fixed in v1.3.7, now on CRAN. Will keep a close eye on data.table package class assignment.