Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

labkey.domain.createConditionalFormat

Create a conditional format data frame


Description

Create a conditional format data frame.

Usage

labkey.domain.createConditionalFormat(queryFilter, bold=FALSE, italic=FALSE,
    strikeThrough=FALSE, textColor="", backgroundColor="")

Arguments

queryFilter

a string specifying what logical filter should be applied

bold

a boolean for if the text display should be formatted in bold

italic

a boolean for if the text display should be formatted in italic

strikeThrough

a boolean for if the text display should be formatted with a strikethrough

textColor

a string specifying the hex code of the text color for display

backgroundColor

a string specifying the hex code of the text background color for display

Details

This function can be used to construct a conditional format data frame intended for use within a domain design's conditionalFormats component while creating or updating a domain. The queryFilter parameter can be used in conjunction with labkey.domain.createConditionalFormatQueryFilter for convenient construction of a query filter string. Multiple conditional formats can be applied to one field, where each format specified constitutes a new row of the field's conditionalFormats data frame. If text formatting options are not specified, the default is to display the value as black text on a white background.

Value

The data frame containing values describing a conditional format.

Author(s)

Rosaline Pyktel

See Also

Examples

library(Rlabkey)

domain <- labkey.domain.get(baseUrl="http://labkey/", folderPath="home",
    schemaName="lists", queryName="test list")

## update the third field to use two conditional formats
qf <- labkey.domain.FILTER_TYPES
cf1 = labkey.domain.createConditionalFormat(labkey.domain.createConditionalFormatQueryFilter(qf$GT,
      100), bold=TRUE, text_color="D33115", background_color="333333")
cf2 = labkey.domain.createConditionalFormat(labkey.domain.createConditionalFormatQueryFilter(
      qf$LESS_THAN, 400), italic=TRUE, text_color="68BC00")
domain$fields$conditionalFormats[[3]] = rbind(cf1,cf2)

labkey.domain.save(baseUrl="http://labkey/", folderPath="home",
    schemaName="lists", queryName="test list", domainDesign=domain)

Rlabkey

Data Exchange Between R and 'LabKey' Server

v2.6.0
Apache License 2.0
Authors
Peter Hussey
Initial release
2021-02-02

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.