I am not able to import zipped files from the following link. How to get thw same in to R?. mydata <- read.csv("http://nseindia.com/content/historical/EQUITIES/2010/JAN/cm15JAN2010bhav.csv.zip")
Velappan Periasamy wrote:> > I am not able to import zipped files from the following link. > How to get thw same in to R?. > mydata <- > read.csv("http://nseindia.com/content/historical/EQUITIES/2010/JAN/cm15JAN2010bhav.csv.zip") >As Brian Ripley noted in http://markmail.org/message/7dsauipzagq5y36o you will have to download it first and then to unzip. Dieter -- View this message in context: http://n4.nabble.com/Data-import-export-zipped-files-from-URLs-tp1017287p1017326.html Sent from the R help mailing list archive at Nabble.com.
Dieter Menne wrote:> > Velappan Periasamy wrote: >> I am not able to import zipped files from the following link. >> How to get thw same in to R?. >> mydata <- >> read.csv("http://nseindia.com/content/historical/EQUITIES/2010/JAN/cm15JAN2010bhav.csv.zip") >> > > As Brian Ripley noted in > > http://markmail.org/message/7dsauipzagq5y36o > > you will have to download it first and then to unzip.Well if downloading to disk first does need to be avoided, you can use the RCurl and Rcompression packages to do the computations in memory: library(RCurl) ctnt = getURLContent("http://nseindia.com/content/historical/EQUITIES/2010/JAN/cm15JAN2010bhav.csv.zip") library(Rcompression) zz = zipArchive(ctnt) names(zz) txt = zz[[1]] read.csv(textConnection(txt)) D.> > Dieter > >
If you need an example of this look at the yacasInstall function in this file: http://ryacas.googlecode.com/svn/trunk/R/yacasInstall.R from the Ryacas package. It downloads, unzips and installs yacas and associated files for Windows users. On Tue, Jan 19, 2010 at 3:10 AM, Dieter Menne <dieter.menne at menne-biomed.de> wrote:> > > Velappan Periasamy wrote: >> >> I am not able to import zipped files from the following link. >> How to get thw same in to R?. >> mydata <- >> read.csv("http://nseindia.com/content/historical/EQUITIES/2010/JAN/cm15JAN2010bhav.csv.zip") >> > > As Brian Ripley noted in > > http://markmail.org/message/7dsauipzagq5y36o > > you will have to download it first and then to unzip. > > Dieter > > > -- > View this message in context: http://n4.nabble.com/Data-import-export-zipped-files-from-URLs-tp1017287p1017326.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
How to unzip this file?.> mydata <- unzip("http://nseindia.com/content/historical/EQUITIES/2010/JAN/cm15JAN2010bhav.csv.zip")Warning message: In unzip("http://nseindia.com/content/historical/EQUITIES/2010/JAN/cm15JAN2010bhav.csv.zip") : error 1 in extracting from zip file>