I have a zipped file named "mygeodata.zip" in my desktop. This file contains two excel sheets of form xlsx, named "NOMES.xlsx" and "POLIGONAIS.xlsx"
I was wondering how I could read this zipped folder in R from my desktop.
I have a zipped file named "mygeodata.zip" in my desktop. This file contains two excel sheets of form xlsx, named "NOMES.xlsx" and "POLIGONAIS.xlsx"
I was wondering how I could read this zipped folder in R from my desktop.
You can extract the zipped files in a folder with unzip
. Use list.files
to read the two files individually.
library(readxl)
unzip("mygeodata.zip", exdir = 'temp')
files <- list.files('temp', pattern = 'xlsx$', full.names = TRUE)
file1 <- read_excel(files[1])
file2 <- read_excel(files[2])
Or use lapply
to read them in a list.
list_data <- lapply(file1, read_excel)