Skip to contents

Assigns selected colors to levels of a series variable to be used for plotting and legend.

Usage

g_seriescol(gdata, series_color = NA, SERIESVAR = "TRTVAR")

Arguments

gdata

Data being used to create graph

series_color

Tilde-separated colors corresponding to values in SERIESVAR

SERIESVAR

Series Variable to assign colors to. Examples: "TRTVAR","ETHNIC" Preferably a variable of type factor with distinct levels

Value

named list of colors per level of grouping variable

Examples

data("adsl")
g_seriescol(adsl, "red~cyan~forestgreen~black", "TRT01A")
#>              Placebo Xanomeline High Dose  Xanomeline Low Dose 
#>                "red"               "cyan"        "forestgreen"