R Reading in a zip data file without unzipping it

后端 未结 7 2249
青春惊慌失措
青春惊慌失措 2020-12-04 15:22

I have a very large zip file and i am trying to read it into R without unzipping it like so:

temp <- tempfile(\"Sales\", fileext=c(\"zip\"))
data <- re         


        
7条回答
  •  青春惊慌失措
    2020-12-04 15:57

    If your zip file is called Sales.zip and contains only a file called Sales.dat, I think you can simply do the following (assuming the file is in your working directory):

    data <- read.table(unz("Sales.zip", "Sales.dat"), nrows=10, header=T, quote="\"", sep=",")
    

提交回复
热议问题