subarray-scidbst-method: Subarray function for scidbst object

Description Usage Arguments Details Value Note See Also Examples

Description

This function is based on the scidb subarray function. It will create a subset of the array based on the stated dimension limits. Based on the 'between' parameter either the 'subarray' or the 'between' function will be used in SciDBs AFL query. When 'between is set TRUE, then the spatial and/or temporal references will not be changed, because the dimension values are not recalculated. If 'subarray' is used in scidb, then the dimension values are shifted to the new lower boundaries, which requires an adaption of the references (if necessary). In either case the resulting scidbst object will have a modified dimensional extent.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## S4 method for signature 'scidbst,numeric'
subarray(x, limits, between = FALSE)

## S4 method for signature 'scidbst,character'
subarray(x, limits, between = FALSE)

## S4 method for signature 'scidbst,Extent'
subarray(x, limits, between = FALSE)

## S4 method for signature 'scidbst,TemporalExtent'
subarray(x, limits, between = FALSE)

## S4 method for signature 'scidbst,scidbst'
subarray(x, limits, between = FALSE)

## S4 method for signature 'scidb,numeric'
subarray(x, limits, between = FALSE)

Arguments

x

scidbst array object

limits

vector of coordinate ranges or a character string (see Details) or Extent or TemporalExtent objects

between

(logical) Whether or not the between function shall be used in scidb instead of subarray

Details

Like in the original subarray method limits parameter needs to be either a vector of numerics or characters or a character string. The vector needs to have two times the number of dimension as elements in it. This also applies to the character string, which shall contain the limits divided by commas (','). Examples: c(0,0,0,10,10,10); "0,0,0,10,10,10". Also unbounded dimension statements are supported. Use the asterisk ('*') to define an unbounded dimension value. The scidbst package also allows Extent and TemporalExtent objects as limits. Missing values regarding the spatial extent or temporal extent are kept as is.

Value

modified scidbst array object

Note

The package will provide this function as a generic S4 function. This means that the original subarray method from the scidb package will not be recognized as S4 function. Use scidb::subarray to call the original method.

See Also

subarray, crop,scidbst

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
scidbconnect(...)
chicago = scidbst("chicago_sts")

# Using character strings and vector
chicago_sub1 = subarray(x=chicago,c(501,285,2,901,585,3),between=FALSE) #minimum values, then maximum values for all dimensions
chicago_sub2 = subarray(x=chicago,limits=c("501","285","2","901","585","*"))
chicago_sub3 = subarray(x=chicago,limits="501,285,2,901,585,3")

# Using an extent object
extent = c(448000,451000,4635000,4640000)
chicago_sub4 = subarray(x=chicago,limits=extent,between=FALSE)

# Using a Temporal extent
te = textent(as.POSIXct("2016-05-03"),as.POSIXct("2016-05-05"))
chicago_sub5 = subarray(x=chicago,limits=te,between=FALSE)

## End(Not run)

flahn/scidbst documentation built on May 16, 2019, 1:15 p.m.