Learn R Programming

Rlabkey (version 3.3.0)

getRows: Retrieve data from LabKey Server

Description

Retrive rows from a LabKey Server given a session and query object

Usage

getRows(session, query, maxRows=NULL, colNameOpt='fieldname', ...)

Value

A data frame containing the query results corresponding to the default view of the specified query.

Arguments

session

the session key returned from getSession

query

an object representing a query on LabKey Server, a child object of the object returned by getSchema()

maxRows

(optional) an integer specifying how many rows of data to return. If no value is specified, all rows are returned.

colNameOpt

(optional) controls the name source for the columns of the output dataframe, with valid values of 'caption', 'fieldname', and 'rname'

...

Any of the remaining options to link{labkey.selectRows}

Author

Peter Hussey

Details

This function works as a shortcut wrapper to labkey.selectRows. All of the arguments are the same as documented in labkey.selectRows.

See labkey.selectRows for a discussion of the valid options and defaults for colNameOpt. Note in particular that with getRows the default is 'fieldname' instead of 'caption'.

See Also

getSession, getSchema, getLookups, saveResults labkey.selectRows

Examples

Run this code
if (FALSE) {

## simple example of getting data using schema objects
# library(Rlabkey)

s<-getSession(baseUrl="http://localhost:8080/labkey",
    folderPath="/apisamples")
s  # shows schemas

scobj <- getSchema(s, "lists")
scobj   # shows available queries

scobj$AllTypes  ## this is the query object

getRows(s, scobj$AllTypes)
	
}

Run the code above in your browser using DataLab