View source: R/schemaObjects.R
getSchema | R Documentation |
Creates and returns an object representing a LabKey schema, containing child objects representing LabKey queries
getSchema(session, schemaIndex)
session |
the session key returned from getSession |
schemaIndex |
the name of the schema that contains the table on which you want to base a query, or the number of that schema as displayed by print(session) |
Creates and returns an object representing a LabKey schema, containing child objects representing LabKey queries. This compound object is created
by calling labkey.getQueries
on the requested schema and labkey.getQueryDetails
on each returned query. The information returned in the
schema objects is essentially the same as the schema and query objects shown in the Schema Browser on LabKey Server.
an object representing the schema. The named elements of a schema are the queries within that schema.
Peter Hussey
https://www.labkey.org/Documentation/wiki-page.view?name=querySchemaBrowser
getSession
## Not run:
## the basics of using session, schema, and query objects
# library(Rlabkey)
s<- getSession(baseUrl="http://localhost:8080/labkey",
folderPath="/apisamples")
sch<- getSchema(s, "lists")
# can walk down the populataed schema tree from schema node or query node
sch$AllTypes$Category
sch$AllTypes$Category$caption
sch$AllTypes$Category$type
# can add fields from related queries
lucols <- getLookups(s, sch$AllTypes$Category)
cols <- c(names(sch$AllTypes[2:6]), names(lucols)[2:4])
getRows(s, sch$AllTypes, colSelect=cols)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.