Let's make a pretty map of European rivers using the Global River Classification dataset
๐ง๐ผโ๐ป Check the full tutorial at https://milospopovic.net/map-rivers-with-sf-and-ggplot2-in-r/
Let's make a pretty map of European rivers using the Global River Classification dataset ๐ง๐ผโ๐ป Check the full tutorial at https://milospopovic.net/map-rivers-with-sf-and-ggplot2-in-r/
Home Page: https://milospopovic.net/map-rivers-with-sf-and-ggplot2-in-r/
Let's make a pretty map of European rivers using the Global River Classification dataset
๐ง๐ผโ๐ป Check the full tutorial at https://milospopovic.net/map-rivers-with-sf-and-ggplot2-in-r/
I'm trying to replicate for another region.
I put shp files in a directory on my computer, and adjusted the list.files call in the get)data() function appropriately, but needed to adjust the pattern for it to return the appropriate file.
using here:
library(here)
This didn't appear to work:
filenames <- list.files(path = paste0(here(), "/HydroRIVERS_v10_au_shp"), pattern="*.shp", full.names=TRUE)
This did:
filenames <- list.files(path = paste0(here(), "/HydroRIVERS_v10_au_shp"), pattern="\\.shp", full.names=TRUE)
Probably should use a $ at the end of the pattern as well:
https://stackoverflow.com/a/4876869/4927395`
This could have been a problem at my end though.
I think this should be the correct link?
https://milospopovic.net/map-rivers-with-sf-and-ggplot2-in-r/
I've modified my own get_data() as below:
# Download manually from https://www.hydrosheds.org/products/hydrorivers HydroRIVERS_v10_eu_shp.zip
# or use wget in terminal
# wget https://data.hydrosheds.org/file/HydroRIVERS/HydroRIVERS_v10_eu_shp.zip
get_data <- function(url, res, filenames) {
#unzip("HydroRIVERS_v10_eu_shp.zip") #unzip, need once only
filenames <- list.files("HydroRIVERS_v10_eu_shp", pattern="*.shp", full.names=T)
return(filenames)
}
On a linux machine, comment out this:`
#windowsFonts(georg = windowsFont('Georgia'))`
modify make_map.r: by commenting out text...:
theme(#text = element_text(family = "georg"),
And then make sure (in mainr.r) you source your local make_map.r:
# map_url <- "https://raw.githubusercontent.com/milos-agathon/map-rivers-with-sf-and-ggplot2-in-R/main/R/make_map.r"
# source(map_url) # load script
source("R/make_map.r")
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.