Skip to content
Prev 314051 / 398502 Next

how can I import op.gz files with read.csv or otherwise

Try downloading it and decompress it:

  url <- "ftp://ftp.ncdc.noaa.gov/pub/data/gsod/2012/285880-99999-2012.op.gz"
  dest <- "/home/john/rdata/weather.op.gz"
  download.file(url, dest) 

However it does not look like a nicely formatted file and you may have to do some cleanup in a text editior or perhaps load it into a spreadsheet before you read it into R.  

I tried the method from the link arun provided and it did not work.  It looks like the headers and data are not consistant
John Kane
Kingston ON Canada
read.csv(file="ftp://ftp.ncdc.noaa.gov/pub/data/gsod/2012/285880-99999-2012.op.gz",
"","\025C'\016\vC?B2i;B'4F?C1\002\001Pb??C!\0025B6b?"C"C?{C?C?b?"B9=C?B$4&C0w\\\\QB-B4b?:B-C?B4\"hnC?b?"b?0IB(C?E
____________________________________________________________
FREE 3D EARTH SCREENSAVER - Watch the Earth right on your desktop!