ropensci / neotoma

Programmatic R interface to the Neotoma Paleoecological Database.
https://docs.ropensci.org/neotoma
Other
30 stars 16 forks source link

Bancos Village returns an error for TaxonName. #103

Closed SimonGoring closed 9 years ago

SimonGoring commented 10 years ago

aa <- get_download(10010) API call was successful. Returned record for Bancos Village [LA 4380] Error in count.data$TaxonName : $ operator is invalid for atomic vectors

gavinsimpson commented 10 years ago

There's no sample data getting pulled in for this:

str(aa1$Samples)
List of 1
 $ :List of 7
  ..$ SampleName           : logi NA
  ..$ AnalysisUnitDepth    : logi NA
  ..$ AnalysisUnitName     : chr "Assemblage"
  ..$ SampleID             : num 117750
  ..$ SampleData           : list()
  .. ..- attr(*, "class")= chr "AsIs"
  ..$ SampleAges           :List of 1
  .. ..$ : Named logi [1:6] NA NA NA NA NA NA
  .. .. ..- attr(*, "names")= chr [1:6] "AgeOlder" "Age" "AgeYounger" "ChronologyName" ...
  ..$ AnalysisUnitThickness: logi NA

because this sample seems only to be a single date on a piece of wood.

It is difficult to debug this because the error is in get.sample() which you only define inside get_download(). It would help to move this function definition outside of get_download(), but not export this function. That way we can debug(neotoma:::get.sample.

Need to make get.sample resistant to there being no data for a particular dataset. Perhaps just a check on the object in $SampleData and if it is empty skip some of the processing?

SimonGoring commented 9 years ago

This issue is now resolved.