RcssValue {Rcssplot}R Documentation

Extracts a value from an Rcss object

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

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


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


[Package Rcssplot version 1.0.0 Index]