readbin | R Documentation |
'.gz'
-file as matrix or raster-objectReturns '.gz'
-file as matrix or raster-object.
readbin(filename, area, Image = F, byte = F, Raster = T)
filename |
Character string indicating search criteria for the
See region_definitions for valid area- and parameter_definitions for valid |
Image |
whether the a the |
byte |
whether the a the data of the |
Raster |
whether the a the data of the |
area |
Character string identifying the region that should be extracted. If missing, region is derived from the |
Robert K. Bauer
writebin, regions, crop, raster2matrix, param_convert
### Example: read and plot '.gz'-file
path <- system.file("test_files", package="oceanmap")
check_gzfiles(folder=path) # return file summary-table
gz.files <- Sys.glob(paste0(path,'/*.gz')) # load sample-'.gz'-files
### all manual:
obj <- readbin(gz.files[2],area='lion')
obj
ticks <- seq(20,30,5)
data('cmap')
image(obj,zlim=range(ticks),col=cmap$jet)
plotmap('lion',add=TRUE) # add landmask
#set.colorbar(ticks=ticks,cb.title='cb.title',cb.xlab='cb.xlab')
### using v:
## ticks set by adaptive.vals
v(obj,varname="sst2",cb.title='cb.title',cb.xlab='cb.xlab')
## ticks set by parameter definition
v(obj,varname="sst2",cb.title='cb.title',cb.xlab='cb.xlab',adaptive.vals=FALSE)
### extracting subregion:
obj <- readbin(gz.files[2])
area.extent <- extent(c(5,10,35,40))
subarea <- crop(obj,area.extent)
# v(subarea)
## getting average value:
mean(subarea[,],na.rm=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.