grib_raw_split | R Documentation |
Handle raw GRIB messages by identifying the location of seperate records.
grib_raw_find(msg)
grib_raw_split(msg)
find_in_raw(msg, pattern="GRIB")
msg |
a 'raw' vector, supposedly containing one or more GRIB records. |
pattern |
A character string (ASCII) to be searched in the raw message. |
find_in_raw
returns a vector of the indices in the raw message where the pattern was found. grib_raw_find
returns a data.frame
with columns begin
and end
with the indices of all seperate GRIB records. grib_raw_split
returns a list of all seperate raw GRIB records.
Gopen
, Ghandle
## Not run:
#Get first 5 records of a file.
gzf <- gzfile("some_zipped_gribfile", "rb")
msg <- readBin(gzf, what="raw", n=2E7)
# decode second record:
Gdec(msg, 2)
# or
glist <- grib_raw_split(msg)
mydata <- Gdec(glist[[2]])
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.