View source: R/labkey.domain.R
labkey.domain.inferFields | R Documentation |
Generate field information from the specified data frame. The resulting list can be used to create or edit a domain using the labkey.domain.create or labkey.domain.save APIs.
labkey.domain.inferFields(baseUrl = NULL, folderPath, df)
baseUrl |
a string specifying the |
folderPath |
a string specifying the |
df |
a data frame specifying fields to infer. The data frame must have column names as well as row data to infer the type of the field from. |
Field information can be generated from a data frame by introspecting the data associated with it along with other properties about that column. The data frame is posted to the server endpoint where the data is analyzed and returned as a list of fields each with it's associated list of properties and values. This list can be edited and/or used to create a domain on the server.
The inferred metadata will be returned as a list with an element called : "fields" which contains the list of fields inferred from the data frame. Each field will contain the list of attributes and values for that field definition.
Karl Lum
labkey.domain.get
,
labkey.domain.create
,
labkey.domain.createDesign
,
labkey.domain.createIndices
,
labkey.domain.save
,
labkey.domain.drop
## Not run:
## create a data frame and infer it's fields
library(Rlabkey)
df <- data.frame(ptid=c(1:3), age = c(10,20,30), sex = c("f", "m", "f"))
fields <- labkey.domain.inferFields(baseUrl="http://labkey/", folderPath="home", df=df)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.