I want to read all .csv files from a large zip file into r without unzipping the file. I understand how do to this for each file individually, as follows.
df1<- read_csv(unz("myfile.zip", "file1.csv"))
df2<- read_csv(unz("myfile.zip", "file2.csv"))
df3<- bind_rows(df1, df2)
How can I do this for all files in the zip folder and combine them into a dataframe? I would like to do something like this:
temp = list.files(path= "myfile.zip", pattern="*.csv", full.names = T)
myfiles = map_df(temp, read_csv)
The zip file I am interested in using is major agencies’ award transaction data for fiscal year 2020. The link to zip file is https://files.usaspending.gov/award_data_archive/FY2020_All_Contracts_Full_20221008.zip. The reason that I want to keep unzipped in my working directory is that it takes up too much room on my computer.