Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coord_proj is throwing a "Not implemented error" #4082

Closed
colinaverill opened this issue Jun 22, 2020 · 5 comments
Closed

coord_proj is throwing a "Not implemented error" #4082

colinaverill opened this issue Jun 22, 2020 · 5 comments

Comments

@colinaverill
Copy link

colinaverill commented Jun 22, 2020

Below is some simplified code to plot a world map using ggplot2. This code was working fine for me until April, at which point I started getting Error: not implemented. Line by line testing links this outcome to the coord_proj() line. There was some discussion of this on stackoverflow, but no definitive solution was found. Reproducible example and error messages below.

world <- ggplot2::map_data("world")
world <- world[world$region != "Antarctica",]
gg <- ggplot()
gg <- gg + geom_cartogram(data=world, map=world,
                          aes(x=long, y=lat, map_id=region))
gg <- gg + coord_proj("+proj=wintri")
gg

Error messages:

Error: Not implemented
Run `rlang::last_error()` to see where the error occurred.
> rlang::last_error()
<error/rlang_error>
Not implemented
Backtrace:
  1. (function (x, ...) ...
  2. ggplot2:::print.ggplot(x)
  4. ggplot2:::ggplot_gtable.ggplot_built(data)
  5. base::Map(...)
  6. base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
  8. l$draw_geom(d, layout)
  9. ggplot2:::f(..., self = self)
 10. self$geom$draw_layer(data, self$geom_params, layout, layout$coord)
 11. ggplot2:::f(..., self = self)
 12. base::lapply(...)
 13. ggplot2:::FUN(X[[i]], ...)
 16. ggalt:::f(...)
 17. ggplot2::coord_munch(coord, map, panel_scales)
 18. coord$backtransform_range(range)
 19. ggplot2:::f(..., self = self)
Run `rlang::last_trace()` to see the full context.
@yutannihilation
Copy link
Member

Could you file this issue on ggalt's repo? At the moment, I'm not sure if this is a bug on ggalt's side or on ggplot2's side, but this sounds ggalt needs to implement backtransform_range().

@colinaverill
Copy link
Author

colinaverill commented Jun 22, 2020 via email

@yutannihilation
Copy link
Member

Ah, this one seems the same issue: hrbrmstr/ggalt#62

@clauswilke
Copy link
Member

Not sure what coord_proj() does but I suspect there'll be little need for it once we merge #3659. I can try to finish this off in the next few days. Just one last issue remaining.

@clauswilke
Copy link
Member

Sorry, I was overly optimistic. Winkel tripel is not supported by {sf} (due to lack of inverse transformation) and therefore won't be possible with coord_sf().

If you want to make a map using this projection, I suggest you follow this tutorial:
https://wilkelab.org/practicalgg/articles/Winkel_tripel.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants