Skip to content

Issue mapping data to alpha #992

Closed
Closed
@cpsievert

Description

@cpsievert
library(sf)
library(dplyr)
library(plotly)
data(gapminder, package = "gapminder")
g07 <- gapminder[gapminder$year==2007,]
data(wrld_simpl, package="maptools")

wrld_simpl <- wrld_simpl %>%
    st_as_sf() %>%
    mutate(country=as.character(NAME))

g_shf <- left_join(wrld_simpl, g07)

gg <- ggplot(g_shf)+
    geom_sf(aes(alpha=gdpPercap), fill="red")
ggplotly(gg)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions