Parse a reference to a variable within a file

parse_vardef(vardef)

Arguments

vardef

A variable definition, constructed using the following syntax: <filename>::<variables_or_bands> where <variables_or_bands> is a comma-separated list of band numbers or variable names.

A limited amount of transformation can be specified by adding extra characters to the band number or variable name:

  • Variables can be renamed by appending ->new_var_name

  • Data can be transformed by appending transformations such as @negate@fill0

A complete example is: PETmE_freq_trgt201701.img::1@fill0@negate->Neg_PETmE

In this example, band 1 is read from the file. NODATA values are replaced with zero, and all values are negated. The values are read into a variable called Neg_PETmE.

Value

a list containing:

filename

The filename containing the data

vars

A list of variables within the file. If NULL, then all variables within the file should be read.