Closed SimonGoring closed 9 years ago
So it's clearly an error in the assignment of chronology.id
s. Changing the code to:
new.downs2<-lapply(new.downs, function(x)try(get_chroncontrol(x)))
which(sapply(new.downs2, class) == 'try-error')
returns:
#> 1776 3051 3483 3869 3973 4196 4197 14839 15628
#> 579 942 977 1039 1093 1228 1229 1624 1800
Of these, 5 have NA values for the chronology.id
. It's a bit strange:
Of the remaining records (dataset IDs 1376, 1430, 7878 and 8294), we get the error:
#> Error in do.call(rbind.data.frame, lapply(aa, "[[", "controls")[[1]]) :
#> second argument must be a list
It looks like the problem arises from the fact that all of these only have a single object in their chroncontrol table, causing control.table <- do.call(rbind.data.frame, lapply(aa, '[[', 'controls')[[1]])
to fail.
This is fairly easy to fix (in general).
This seems to have been resolved in v1.3.0, the errors must have been from the use of an older version. I'm going to close this issue.
I was wrong. This is a different error than the one I fixed. This one is caused by NA
values in the chronology table.
This error now seems to be resolved following commit https://github.com/ropensci/neotoma/commit/b13cf352b6f042792ad44b464605288cb88d98c3 which now does the check for NA values in the chronology.id
before it gets passed to the API.
A user has reported that the following code:
returns the following message:
I'm not sure if this is an error with a poorly assigned
chronology.id
(or empty value) passed by Neotoma itself or an error in the function. I'm running some tests to see. If it's the site I'll add a try-catch and put something in the tests.