RcssValue: Extracts a value from an Rcss object

Description Usage Arguments Value Examples

View source: R/RcssGet.R

Description

If the selector and property are defined in the Rcss object, this function will return the value stored in the Rcss object. Otherwise, the function will return a default value. See also related functions RcssGetPropertyValueOrDefault, which is the same, except that RcssValue is shorter to write and takes the Rcss object as its last argument.

Usage

1
2
3
4
5
6
7
RcssValue(
  selector,
  property,
  default = NULL,
  Rcssclass = NULL,
  Rcss = "default"
)

Arguments

selector

character, name of selector, e.g. 'points'

property

character, name of property to get, e.g. 'col'

default

value to return if selector/property are not defined

Rcssclass

character or vector, subclass in Rcss

Rcss

Rcss object

Value

a value from the Rcss object

Examples

1
2
3
style1 <- Rcss(text="custom { key: 100 }")
RcssValue("custom", "key", default=1, Rcss=style1)
RcssValue("custom", "key2", default=0, Rcss=style1)

Rcssplot documentation built on Jan. 8, 2020, 5:11 p.m.