Description Usage Arguments Details Value Author(s) See Also Examples
This collection of functions is used to create lists of variables from Causata. The lists can be inputs to queries using the Causata SQL interface.
1 2 3 4 5 6 7 8 9 10 11 12 | ## S3 method for class 'Connect'
Vinclude(this, name.patterns=NULL, label.patterns=NULL,
and=TRUE, ...)
## S3 method for class 'Connect'
Vexclude(this, variable.names=NULL, name.patterns=NULL,
label.patterns=NULL, and=TRUE, ...)
## S3 method for class 'Connect'
Vtime(this, variable.names, domains, ...)
BacktickCollapse(variable.names)
|
this |
An object from the class |
name.patterns |
A character vector of variable system name patterns that will be used with |
label.patterns |
A character vector of variable label names patterns that will be used with |
and |
If multiple filtering arguments are supplied, then this controls whether variables have to match all of
the criteria ( |
variable.names |
Character vector containing Causata variable system names. |
domains |
Character vector containing Causata variable time domains. |
... |
Extra unused arguments. |
These functions create lists of variables that are filtered according to the given criteria.
Vinclude
returns a character array of all variables matching the provided criteria. If the
criteria are left at their default values (NULL
) then a list of all available variables is returned.
Vexclude
works in the same manner as Vinclude
, except that variables matching the criteria are excluded.
If variable.names
is NULL
then the matching process begins with all avaible variables.
If variable.names
contains variable names then the matching process will select from the provided names.
Vtime
appends time domains to the variables.
To see a list of the available variables and time domains, open a Connect
object and view the embedded
data frames of variable metadata. See the example below for details.
Vinclude
, Vexclude
, and Vtime
return a vector of character strings naming variables found in Causata.
BacktickCollapse
returns a single character string with the variables names concatenated together and surrounded by
backticks. This string can be used directly in a SQL query to Causata.
Justin Hemann <support@causata.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | # Some of these examples require a Causata connection, so they are not run
## Not run:
conn <- Connect(group="example")
# View available variables
View(conn$variables)
# View available time ranges
View(conn$timeRanges)
# View available time points
View(conn$timePoints)
# Get a list of variables matching the given labels: all online and demographics
variables <- Vinclude(conn, label.patterns=c("online", "demographics"))
# Get a list of all variables except those with "test" in the name
variables <- Vexclude(conn, name.patterns="test")
# build a query string and extract data
query.str <- paste(
"select", BacktickCollapse(variables),
"from customers")
df <- GetData(conn, query.str)
Close(conn)
## End(Not run)
# simple example with BacktickCollapse
BacktickCollapse(c("variable-one", "variable-two"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.