R: Create a conditional format data frame

labkey.domain.createConditionalFormat {Rlabkey} | R Documentation

## 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

`labkey.domain.get`, `labkey.domain.create`, `labkey.domain.createDesign`, `labkey.domain.inferFields`, `labkey.domain.save`, `labkey.domain.drop`, `labkey.domain.createConditionalFormatQueryFilter`, `labkey.domain.FILTER_TYPES`

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

[Package Rlabkey version 2.8.1 Index]