ropensci / spocc

Species occurrence data toolkit for R
https://docs.ropensci.org/spocc
Other
117 stars 27 forks source link

Error combining data from different dbs #145

Closed timcdlucas closed 9 years ago

timcdlucas commented 9 years ago

Not the same error as yesterday. I can't replicate that one but getting this now.

> s <- occ(query = 'Monomorium pharaonis', geometry = c(-180, -90, 180, 90), 
  from = c("gbif", "inat", "ebird", "ecoengine", "antweb"), limit = 1000)

243 results available for query.
Warning messages:
1: In ebird_GET(url, args, ...) : Unknown species: Monomorium pharaonis
2: No records found in eBird for Monomorium pharaonis 
3: No records found in Ecoengine for Monomorium pharaonis 

> occ2df(s)

Error in if (b %in% names(a)) { : argument is of length zero
sckott commented 9 years ago

thanks,

note that you don't need to pass geometry = c(-180, -90, 180, 90) if you want to search everywhere, by default the search isn't restricted in space

sckott commented 9 years ago

@timcdlucas reinstall, see if that work

timcdlucas commented 9 years ago

Oh yeah. The geometry thing is because where we're using it in our package you do need to pass an extent.

Yes that seems to be working. I'll let you know if I find anything else.

Thanks a lot!

sckott commented 9 years ago

The geometry thing is because where we're using it in our package you do need to pass an extent.

okay, makes sense - what package?

timcdlucas commented 9 years ago

Zoon https://github.com/zoonproject/zoon

When I find these problems, I'm running a whole SDM, and then copy the relevant args over. So if there's geometry there I often just copy it by accident.

You might find it an interesting use of the package anyway!

sckott commented 9 years ago

Nice, looks great. Not used in the package though that I can see. Maybe just used in egs?

timcdlucas commented 9 years ago

Ah, the package calls modules which are in github.com/zoonproject/modules.

So the module SpOcc uses it. This is one of the major modules that are used in the vignettes etc.

work <- workflow(occurrence = SpOcc(species = 'Eresus kollari', 
                                                   extent = c(-10, 10, 45, 65)),
                            covariate  = UKAir,
                            process    = BackgroundAndCrossvalid(k = 2),
                            model      = list(LogisticRegression, RandomForest),
                            output     = Chain(SameTimePlaceMap, PerformanceMeasures)
)

for example.

sckott commented 9 years ago

ah, okay, thanks for that.

Do continue to let me know what's broken here, and if you want any other features.

timcdlucas commented 9 years ago

Will do!

sckott commented 9 years ago

you may have already seen, but if you need any cleaning functions, working on a sep package for data cleaning https://github.com/sckott/cleanoccs - there is some stuff in spoccutils, but it's very sparse

timcdlucas commented 9 years ago

Ah nice. Sure it'll be useful as we definitely need some cleaning modules. Also sure we'll pinch some taxize bits at some point as well. And we already use rfigshare.

Basically we'll be using a lot of your packages!

If you ever fancied writing some wrappers for your packages, that'd be great. The hope is for it to become more of a community than it currently is. Still early days though.

sckott commented 9 years ago

If you ever fancied writing some wrappers for your packages, that'd be great

not sure what you're asking here?? clarify?

timcdlucas commented 9 years ago

Sorry, poorly explained.

As in, if you were interested in our package and you wanted to contribute we'd love you to. And by contribute I mean write a module that may be essentially be a wrapper around one of your existing functions. For example the SpOcc module is basically just a wrapper around spocc::occ.

The idea is that each module is quite stand alone and easy to write. 1 little bit of an analysis that then can fit together with other stuff.

Obviously we're going to keep adding stuff, but we want to start getting people to contribute modules. That's quite a central part of the point of the package. We make the framework, then people add stuff. I'm not just trying to blag free work off of you, honest!

sckott commented 9 years ago

if you were interested in our package and you wanted to contribute we'd love you to

cool, thx!

The module approach sounds great. I will have a look soon.

timcdlucas commented 9 years ago

Blag, blag, blag.:)