dkahle / dkahle/ggmap

Issue with aesthetic mapping

Open
#111 2 comments 0 reactions 0 assignees View on GitHub
needs more information
Dominant language
R
Stars
778
Forks
234
PR merge metrics
No merged PRs in 30d

Description

Please note that in the following example `geom_density` is being used as a stand-in for a custom stat/geom that I wrote for internal projects at my office.

``` r
library(ggmap)
bbox <- c(left=-.1, bottom=-.1, right=1.1,top=1.3 )
zm <- calc_zoom(bbox)
map <- get_openstreetmap(bbox, OSM_scale_lookup(zm))
dat <- data.frame(x=runif(100))

# this works
ggmap(map, base_layer = ggplot(dat))+geom_density(aes(x=x), fill="green")
```

![ggmap_density](https://cloud.githubusercontent.com/assets/5813515/19325505/71def21e-9094-11e6-9488-e2a5d2477c6e.png)

``` r
# this produces an error
ggmap(map)+geom_density(aes(x=x),data=dat, fill="green")
```

> Error in eval(expr, envir, enclos) : object 'lat' not found

``` r
# a different error
ggmap(map)+geom_density(aes(x=runif(100)), fill="green")
```

> Error: Aesthetics must be either length 1 or the same as the data (4): x, y

Tested under `R 3.3.1` with `ggmap 2.6.1` on Windows

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the three ggmap and geom_density examples with R 3.3.1 and ggmap 2.6.1, then inspect how ggmap handles aesthetic mappings and supplied data. Done means the reported mapping cases no longer produce the lat, x, or y errors while preserving the expected density overlay.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.