Learn R Programming

Rlabkey (version 2.8.0)

getSession: Creates and returns a LabKey Server session

Description

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.

Usage

getSession(baseUrl, folderPath="/home",
    curlOptions=NULL, lkOptions=NULL)

Arguments

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

Value

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. See the Rlabkey Users Guide for more discussion of how the user identity is established.

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()

See Also

getRows, getSchema, getLookups saveResults The Rlabkey Users Guide is available by typing RlabkeyUsersGuide().

Examples

Run this code
# 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)

# }

Run the code above in your browser using DataLab