Problem with packages/files

Hi, i'm a French student and I have some project to do.
It is very "basic", I want to create a map with a french region, cities and polling stations
Here is my code, R can't find the 3 files but i'm sure they are in the good place so I don't understand

thank you for your help

install.packages("ggplot2")

install.packages(c("ggplot2","devtools", "dplyr", "stringr" ))
install.packages(c("maps", "mapdata", "sf", "units", "gghighlight"))

library(ggplot2); library(stringr) ; library(ggmap); library(maps); library(sf)
library(mapdata); library(units); library(gghighlight); library(ggsflabel)

imgwd <- "C:/Users/Sandrine/Documents/PROJETJOAQINthomas/FICHIERS R STUDIO"

PB_CONTOUR <- st_read(file.path(imgwd, "contours-pays-basque.json"))
COMMUNES <- st_read(file.path(imgwd, "contours-communes.json"))
BUREAUX <- st_read(file.path(imgwd, "contours-bureaux-vote.json"))

ggplot()+
geom_sf(data=PB_CONTOUR, fill="red", color="red",alpha=.8)+
geom_sf(data=COMMUNES, fill="white", color="black",alpha=.8)+
geom_sf(data=BUREAUX, fill="red", color="red",alpha=.8)

What's the detailed error message? What's the result of?:

list.files(path = imgwd)

Hope it helps,
Grzegorz

thank you for the reply

list.files(path = imgwd)
[1] "contours-bureaux-vote.json" "contours-communes.json" "contours-pays-basque.json"

Set your working directory to "C:/Users/Sandrine/Documents/PROJETJOAQINthomas/FICHIERS R STUDIO" and load your files directly.

setwd("C:/Users/Sandrine/Documents/PROJETJOAQINthomas/FICHIERS R STUDIO")

PB_CONTOUR <- st_read("contours-pays-basque.json")

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.