Dear R-Family, I have just downloaded a massive data file from internet (AphroJP_62STN_V1005.1900.gz). Apparently, the file is compressed with .gz. When I uncompressed it, the file was saved in the name (AphroJP_62STN_V1005.1900) of unknown format. How can I open it in R? thankyou very much indeed in advance, Eliza [[alternative HTML version deleted]]
> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of eliza botto > Sent: Monday, March 17, 2014 12:06 PM > To: r-help at r-project.org > Subject: [R] open unknown file format in R > > Dear R-Family, > I have just downloaded a massive data file from internet > (AphroJP_62STN_V1005.1900.gz). Apparently, the file is compressed with > .gz. When I uncompressed > it, the file was saved in the name (AphroJP_62STN_V1005.1900) of > unknown format. How can I open it in R? > thankyou very much indeed in advance, > Eliza > [[alternative HTML version deleted]] > > ______________________________________________ > 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.Well, if it is not a text file that you can look at, then you will need to get a description of the file from the creators of the file (or from somebody who has used the file and knows the format). Dan Daniel J. Nordlund, PhD Research and Data Analysis Division Services & Enterprise Support Administration Washington State Department of Social and Health Services
If it's a text file, any of the usual functions, such as read.table(), scan(), etc. If it's a binary file, try readBin() It's up to you to find out what kind of a file it is, and how the data is structured within the file. (hint: on a unix-alike system, the 'file' command will tell you something useful. or just try opening it with a text editor) -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 3/17/14 12:06 PM, "eliza botto" <eliza_botto at hotmail.com> wrote:>Dear R-Family, >I have just downloaded a massive data file from internet >(AphroJP_62STN_V1005.1900.gz). Apparently, the file is compressed with >.gz. When I uncompressed >it, the file was saved in the name (AphroJP_62STN_V1005.1900) of unknown >format. How can I open it in R? >thankyou very much indeed in advance, >Eliza > [[alternative HTML version deleted]] > >______________________________________________ >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.
Hello, It is in binary format. I didn't use stations. But to read the gridded format, I used:> readBin(fid, numeric(), n=1e8, size=4, signed=TRUE, endian='little')where file is the connection created with file() Hope this helps, Pascal On Tue, Mar 18, 2014 at 4:06 AM, eliza botto <eliza_botto at hotmail.com> wrote:> Dear R-Family, > I have just downloaded a massive data file from internet (AphroJP_62STN_V1005.1900.gz). Apparently, the file is compressed with .gz. When I uncompressed > it, the file was saved in the name (AphroJP_62STN_V1005.1900) of unknown format. How can I open it in R? > thankyou very much indeed in advance, > Eliza > [[alternative HTML version deleted]] > > ______________________________________________ > 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.-- Pascal Oettli Project Scientist JAMSTEC Yokohama, Japan