Learn R Programming

gmDatabase (version 0.5.0)

gmClass: Returning information from geometallurgicala database

Description

Get information on given object or variable from the database.

Usage

gmClass(expr, var, envir=parent.frame(), EXPR=substitute(expr),db=getOption("gmDB")) gmClassMembers(expr, var, envir=parent.frame(), EXPR=substitute(expr), db=getOption("gmDB"))

Arguments

expr
R expression of an SQL query. Expressions created with gmExpr can be used as well.
var
a number or variable name specifying a variable.
envir
defines the environment used for evaluation of expr
EXPR
The quoted version of such an expression.
db
defines the database, on which the query will be run.

Value

gmClass returns a data frame containing the id, gmVarID, gmVarTypeID, gmVarName, and gmVarDescription of the desired variable or object. If the object is not distinct, then information for every object retrieved. gmClassMembers returns a data frame containing the gmVarID and gmVarName of this all of the possible given members of variable respectively object. required is a boolean stating if the member is mandatory or not, definer states the variable, where this member is defined. If it is not inheritated, then the variable itself is given.

Details

If you want information on a special variable in the database, specify var. You may use its variable id or the variable name. If var is missing information on the object(s) specified by expr is retrieved.

gmClass gives information on the variable itself or the variable the object is. gmClassMembers shows information about all possible members of a variable or the variable the object is.

See Also

gmGet

Examples

Run this code
## Not run: 
# .gmDB <- dbConnect(...)
# root <- "root"
# gmClass(root)
# ## returns information on the root in the database
# 
# gmClass(root$project)
# ## returns information on every project in root in the database
# 
# gmClass(var="project")
# ## returns information on the variable/class project
# 
# gmClass(var=2)
# ## returns information on the variable with variable id 2
# ## End(Not run)

Run the code above in your browser using DataLab