View source: R/schemaObjects.R
getSession | R Documentation |
The session object holds server address and folder context for a user working with LabKey Server. The session-based model supports more efficient interactive use of LabKey Server from R.
getSession(baseUrl, folderPath="/home",
curlOptions=NULL, lkOptions=NULL)
baseUrl |
a string specifying the address of the LabKey Server, including the context root |
folderPath |
a string specifying the hierarchy of folders to the current folder (container) for the operation, starting with the project folder |
curlOptions |
(optional) a list of curlOptions to be set on connections to the LabKey Server, see details |
lkOptions |
(optional) a list of settings for default behavior on naming of objects, see details |
Creates a session key that is passed to all the other session-based functions. Associated with the key are a baseUrl and a folderPath which determine the security context.
curlOptions
The curlOptions parameter gives a mechanism to pass control options down to the RCurl library used by Rlabkey. This can be very useful for debugging problems or setting proxy server properties. See example for debugging.
lkOptions
The lkOptions parameter gives a mechanism to change default behavior in the objects returned by Rlabkey.
Currently the only available options are colNameOpt
, which affects the names of columns in the data frames returned
by getRows(), and maxRows
, which sets a default value for this parameter when calling getRows()
getSession returns a session object that represents a specific user within a specific project folder within the LabKey Server identified by the baseUrl. The combination of user, server and project/folder determines the security context of the client program.
Peter Hussey
getRows
, getSchema
, getLookups
saveResults
## Not run:
# library(Rlabkey)
s <- getSession("https://www.labkey.org", "/home")
s #shows schemas
## using the curlOptions for generating debug tracesof network traffic
d<- debugGatherer()
copt <- curlOptions(debugfunction=d$update, verbose=TRUE,
cookiefile='/cooks.txt')
sdbg<- getSession(baseUrl="http://localhost:8080/labkey",
folderPath="/apisamples", curlOptions=copt)
getRows(sdbg, scobj$AllTypes)
strwrap(d$value(), 100)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.