gmExpr creates a gmExpression
- an R-like representation of an SQL query.
- defines the environment used for evaluation of
- The quoted version of such an expression.
- further arguments for later use in other methods.
gmExpr creates an object of class
gmExpr, which can be used as argument in
gmRead instead of a string. Furthermore it can be extended like any other expression used in
For use in the geometallurgical database you need to begin every expression with
root, since data storage starts from this common root object.
The composition of an expression is done in the following way: for accessing a certain object in a class, use the
$-operator, to access its elements use square brackets
. By specifying
columnName=operation the user can control the content of a column in the the output. Named columns are always shown in the result. If they need to be dropped set them to operation
drop. If you want to group objects by a named column, set its operation to
group. This grouping can only be done for elements at least one step down in the hierarchy.
An object of class
gmExpr, containing the expression in
expr <- gmExpr(root$project) ## Not run: # gmConnectServer(MySQL(), ...) # gmRead(expr$series) # # gmRead(expr$series[name=gmTitle, name=drop]) # ## naming the element gmTitle as name and dropping it in the result # # gmRead(expr[pID=id]$series[name=gmTitle, pID=group]) # ## grouping the series by their corresponding project in the result # ## End(Not run)