ropensci-archive / MODISTools

Repository moved
https://github.com/bluegreen-labs/MODISTools/
Other
50 stars 26 forks source link

Error using mt_bach_subset #32

Closed aberenicega closed 3 years ago

aberenicega commented 3 years ago

Hello!

I'm trying to use the mt_bach_subset function, but I only got this error: Error in checkForRemoteErrors(val) : I installed the package in various R versions (3.5.3, 3.6.0, 4.05), but every time I run this function I get the same Error. I think this error could be because of my R configuration, but I can't find the solution.

Cheers, Bere

khufkens commented 3 years ago

Could you give more information on your system. Also, run the demo code a couple of times and see if you get the same error.

df <- data.frame("site_name" = paste("test",1:2))
df$lat <- 40
df$lon <- -110

# test batch download
subsets <- mt_batch_subset(df = df,
                     product = "MOD11A2",
                     band = "LST_Day_1km",
                     internal = TRUE,
                     start = "2004-01-01",
                     end = "2004-02-01")
aberenicega commented 3 years ago

Thanks for your quick response.

I ran the demo, and I didn't get any warning and data was retrieved correctly. I already solved my problem. I reviewed again my data frame, and I found a couple of mistakes in there. In the columns' names of the data frame I had "long" instead "lon" and also I had the order columns wrong. I mean lon was labeled as lat, and lat as lon. I guess the function mt_bach_subset couldn't find any valid value and for only give me an unspecific warning. I tell you this because it might be better if when a user has a data frame error (like my labeled wrong columns or wrong column order) or the function just can't find the selected data, they get a specific warning to do more friendly the use of your package. In my case, the error printed on the console suggested an error related to the cluster or parallels, but that was not the real problem.

Best

khufkens commented 3 years ago

Sadly I've limited time to invest in packages, as this is all free labour. Feel free to add documentation or code improvements. I'll happily accepted contributions. Especially documentation and user design / interface considerations (warning / error messages) ask too much of me for proportionally no gain in functionality. It's hard to continue to find the motivation for these issues, which are encountered in only a negligible fraction of use cases (or overall, given the niche use of the package).