area_extrac: Extracts a pre-defined region from ".gz"-file and saves...

Description Usage Arguments Author(s) See Also Examples

View source: R/area_extrac.r

Description

Extracts a pre-defined region from '.gz'-file and saves subset as a new '.gz'-file (gzip compressed format). Basically it represents a combined call of regions, crop, raster2matrix and writebin.

Usage

1
area_extrac(obj,area)

Arguments

obj

Character string indicating search criteria for '.gz'-files.

area

Character string identifying the region that should be extracted. area must be a subregion of the original region defined by the '.gz'-file. See region_definitions for area definitions and use add.region to add new regions.

Author(s)

Robert K. Bauer

See Also

readbin, writebin, crop, raster2matrix, param_unconvert

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Example 1: extract, write '.gz'-files, following default plot-procedure
library(raster)

# load sample-'.gz'-file
path <- system.file("test_files", package="oceanmap")
gz.files <- Sys.glob(paste0(path,'/*.gz'))[1] # load sample-'.gz'-files
print(gz.files)
# area_extrac(gz.files[1],area='lion')

# gz <- Sys.glob(path,'/medw4*.gz') # load new-'.gz'-file
# v(gz) # visualize new-'.gz'-file
# system(paste('rm', gz))       
# v(gz.files[1],v_area='lion')

oceanmap documentation built on March 23, 2020, 5:06 p.m.