Connect(sql.server.host, sql.server.port, sql.username, sql.password, group=NULL, verbose=FALSE)
"GetData"(conn, query, ...)
"GetCausataData"(conn, query, dependent.variable, ...)
"GetRawData"(conn, query, ...)
"GetQuery"(this, ...)
"GetNames"(this, kind, ...)
"Close"(conn, ...)
LoadCausataConfig
.
If the same parameter is provided in the configuration file and the function argument then the function argument will take precedence.Connect
.Query
.CausataData
object.'display'
and 'system'
.CausataData
.Connect
returns an object of class Connect
. GetData
and GetRawData
return
data frames, while GetCausataData
returns an object of class CausataData
.
Finally, GetNames
returns a character vector of variable names.
Connect
opens a SQL connection to a Causata server using functions from the RMySQL
package.
GetData
executes the provided query and returns data in a data frame.
GetCausataData
executes the provided query and returns data in a CausataData
object.
GetRawData
returns unaltered data from the lower level query commands.
Close
simply closes a database connection.
GetData
and GetRawData
return data encoded in different formats using the Causata SQL interface.
GetData
is consistent with Causata data exported into CSV files, so it should generally be used instead of
GetRawData
.
The default behavior when using SQL queries of Causata within R
is that boolean data in Causata is returned as numeric (1=TRUE, 0=FALSE), and text data is returned as
characters. The other functions, GetData
and GetCausataData
, convert boolean data to
factors with level names "true" and "false", and return character data as factors. This is the same format
as data exported from Causata to CSV files.
GetNames
is used to return the system names or display names for Causata variables.
Connect
, Query
, CausataData
,
RMySQL
, LoadCausataConfig
.
# This command requires a connection to a Causata server
# the example below is for illustration only
## Not run:
# conn <- Connect(hostname="example.causata.com", username="exampleuser",
# password="examplepassword")
# data <- GetData(conn, Query())
# Close(conn)## End(Not run)
Run the code above in your browser using DataLab