Skip to content

support for sf objects #7

@dominicroye

Description

@dominicroye

I have tried to use geom_glowpath() with a simple feature line, but it's always giving the grouping error of only one observation when I include stat = "sf_coordinates". It works fine with points.

library(sf)
library(ggshadow)
library(tidyverse)

# point glow with sf
point <- st_point(c(4.351667, 50.846667)) |> 
                st_sfc(crs = 4326) |>
                 st_transform(3035)

ggplot(point, aes(geometry = geometry)) + geom_glowpoint(stat = "sf_coordinates", size = 5)  

# line 
pointbdf <- st_buffer(point, units::as_units(2500, "km")) |> 
                        st_as_sf() |> 
                          st_cast("LINESTRING") 
                 
ggplot(pointbdf, aes(geometry = x)) + geom_glowpath(stat = "sf_coordinates") 
geom_glowpath: Each group consists of only one observation. Do you need to adjust the group aesthetic?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions