Code Monkey home page Code Monkey logo

Comments (21)

karthik avatar karthik commented on June 11, 2024

Not sure what's going on with your call but here's what I get.

ecoengine_data <- occ(query = "Lynx rufus californicus", from = "ecoengine")
> ecoengine_data$ecoengine
$meta
$meta$source
[1] "ecoengine"

$meta$time
[1] "2014-01-28 23:35:51.092 PST"

$meta$query
[1] "Lynx rufus californicus"

$meta$type
[1] "sci"

$meta$opts
list()


$data
$data$Lynx_rufus_californicus
                                                                       url
1  http://ecoengine.berkeley.edu/api/observations/LACM%3AMammals
...

Now when I plot it:

> mapggplot(ecoengine_data)
Map from URL : http://maps.googleapis.com/maps/api/staticmap?center=36.962747,-118.986366&zoom=5&size=%20640x640&scale=%202&maptype=terrain&sensor=false
Google Maps API Terms of Service : http://developers.google.com/maps/terms

screencapture at tue jan 28 23 38 54 pst 2014

Can you post a screenshot of the map?

from spocc.

karthik avatar karthik commented on June 11, 2024

Maybe @sckott can verify so it's not something that just works for me.

from spocc.

sckott avatar sckott commented on June 11, 2024

Hmm, I get

screen shot 2014-01-29 at 12 38 04 pm

from spocc.

emhart avatar emhart commented on June 11, 2024

That's what I was getting last night @sckott

from spocc.

karthik avatar karthik commented on June 11, 2024

Really bizarre. The call that goes to ecoengine is this:

x <- ee_observations(scientific_name = "Lynx rufus californicus", georeferenced= TRUE)
# The data are in x$data

Here's the output

and when I drag that csv onto MapBox returns the same thing (in case something is off in this package).

image

So I'm confused. When you look at ecoengine_data$ecoengine, what does it look like?

from spocc.

karthik avatar karthik commented on June 11, 2024

PS: You might want to update ecoengine.

install_github("ropensci/ecoengine")

from spocc.

sckott avatar sckott commented on June 11, 2024

Yep, I did update before trying. I'm getting 1-n integers for each record:

<r> ecoengine_data$ecoengine$data[[1]][,c('longitude','latitude')]
   longitude latitude
1          1        1
2          2        2
3          3        3
4          4        4
5          5        5
6          6        6
7          7        7
8          8        8
9          9        9
10        10       10
11        11       11
12        12       12
13        13       13
14        10       10
15        14       14
16        15       15
17        16       16
18        17       17
19        18       18
20        19       19
21        20       20
22        21       21
23        22       22
24        23       23
25        24       24

from spocc.

karthik avatar karthik commented on June 11, 2024

and mine just returned:

> ecoengine_data$ecoengine$data[[1]][,c('longitude','latitude')]
   longitude latitude
1  -120.4864 35.90087
2  -120.8068 38.72881
3  -122.5522 37.84149
4  -122.8971 38.79410
5  -121.9210 37.59783
6  -120.3390 34.47304
7  -121.8948 37.63383
8  -123.1208 40.75250
9  -122.1949 41.40901
10 -123.2625 38.79764
11 -122.1845 37.90764
12 -123.1780 38.52665
13 -122.2845 38.63194
14 -123.2625 38.79764
15 -122.9462 38.92621
16 -119.5992 37.73661
17 -121.6211 36.80715
18 -121.6428 37.34154
19 -121.7413 36.48891
20 -121.9619 40.31870
21 -123.1181 39.22075
22 -121.1248 35.92967
23 -122.7584 37.94777
24 -116.4701 32.60522
25 -122.4222 37.55764

from spocc.

karthik avatar karthik commented on June 11, 2024

for the record I reinstalled both packages from GitHub.

from spocc.

karthik avatar karthik commented on June 11, 2024

I can confirm the same behavior as @sckott on our rstudio.ropensci.org. Totally confused.

from spocc.

sckott avatar sckott commented on June 11, 2024

I think this is the offending code

suppressWarnings(as.numeric(obs_data_all$latitude))

In that obs_data_all$latitude is a factor, so then when you do as.numeric it doesn't do the right thing, so doing

suppressWarnings(as.numeric(as.character(obs_data_all$latitude)))

should work

from spocc.

sckott avatar sckott commented on June 11, 2024

Maybe you have an options setting that does factor to numeric correctly for you?

from spocc.

karthik avatar karthik commented on June 11, 2024

Right, I'm checking the same bits. I wonder if my .rprofile options strings as factors set to FALSE is causing the issue.

from spocc.

karthik avatar karthik commented on June 11, 2024

It works fine for me though.

from spocc.

karthik avatar karthik commented on June 11, 2024

Yup, that was it! I can replicate the bug in R --vanilla

from spocc.

karthik avatar karthik commented on June 11, 2024

Wondering if CRAN will hate me for pushing an emergency bug fix.

from spocc.

karthik avatar karthik commented on June 11, 2024

Give it a try now, should work.

from spocc.

karthik avatar karthik commented on June 11, 2024

Can you guys do a quick check before I release to CRAN? TIA

from spocc.

emhart avatar emhart commented on June 11, 2024

Works for me with the new version of ecoengine that I installed off github.

from spocc.

sckott avatar sckott commented on June 11, 2024

Works now, cool cool

from spocc.

karthik avatar karthik commented on June 11, 2024

Sweet! Thanks for the bug report, @emhart.
This is why we need code review.

from spocc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.