# gmExpr

0th

Percentile

##### Creating gmExpressions

gmExpr creates a gmExpression

Keywords
utilities
##### Usage
gmExpr(expr,...,envir=parent.frame(),EXPR=substitute(expr))
##### Arguments
expr
an R-like representation of an SQL query.
envir
defines the environment used for evaluation of expr.
EXPR
The quoted version of such an expression.
...
further arguments for later use in other methods.
##### Details

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 gmRead. 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. ##### Value An object of class gmExpr, containing the expression in $EXPR and the envir as attribute.

gmRead

• gmExpr
• root
##### Examples
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)

Documentation reproduced from package gmDatabase, version 0.5.0, License: GPL (>= 2) | LGPL (>= 2)

### Community examples

Looks like there are no examples yet.