ropensci / refsplitr

R package for processing, organizing, and visualizing reference records downloaded from the Web of Science.
https://docs.ropensci.org/refsplitr
Other
55 stars 6 forks source link

in `plot_net_addresses`: migrate to sf from ggplot #91

Closed embruna closed 2 months ago

embruna commented 3 months ago

in plot_net_addresses fortify()` was deprecated in ggplot2 3.4.4. Please migrate to sf.

├─ggplot2::fortify(world_map) └─ggplot2:::fortify.SpatialPolygonsDataFrame(world_map)

embruna commented 3 months ago
  test_sf2 <- test_sf %>% 
   select(LON,LAT,id, ADMIN) %>% 
   rename(long=LON,
            lat=LAT,
            order=id,
            id=ADMIN) %>% 
     mutate(group=paste(id,".1",sep="")) %>% 
     ungroup() %>% 
     select(-geometry) %>% 
     as_tibble()
   str(test_sf2)
   head(test_sf2)
   head(world_map.points)

suggested alterantives to fortify are sf and broom

embruna commented 2 months ago

This response to my SE questions explains how to do this without requiringsf as a dependency