Hi
I have tried to plot map for victoria. It is giving me an error in the following statement with this message? any clues to debugg as I am very new to this.
wynPC <- inner_join(vic_PC_shp, wyn, by = c(POA_CODE21 = "Postcode"))
Error invec_as_location()
:
!...
must be empty.
x Problematic argument:
- call = call
The full code is below:
#postcode shape file australia-wide - will have to download file - available online fairly readily - and then change the address to wherever it is in your drive
aus_PC_shp <- read_sf("C:/Users/wsvin/Documents/R/data/POA_2021_AUST_GDA2020.shp")
#LGA shapefile for VIC - same with above - will have to download and change to your own local drive
vic_lga_shp <- read_sf("C:/Users/wsvin/Documents/R/data/vic_lga.shp")
#Filters the australia-wide postcode shapefile to just Victoria
vic_PC_shp <- aus_PC_shp %>% filter(POA_CODE21 %in% (3000:3999))
#This is the excel file that will have the enrolment information in it - in this case it's only for school
wyn <- read_excel("C:/Users/wsvin/Documents/R/data/wyn students gor.xlsx",col_names= TRUE)
#This is the code for the superimposition of the LGA boundary
wynlga <- vic_lga_shp %>% filter(ABB_NAME == "Wyndham")
#this code creates a table of only the top 5 LGAs (had to manually determine)
gortop5 <- vic_lga_shp %>% filter(ABB_NAME %in% c("Melton", "Wyndham", "Moorabool", "Greater Geelong", "Hobsons Bay"))
#combines the above dataframes into the shapefile for mapping
wynPC <- inner_join(vic_PC_shp, wyn, by = c("POA_CODE21" = "Postcode"))