Assigning class variables in R -
i have data frame dim [72, 592] i.e 72 observations 592 variables. assign observations (rows) 1 37 disease , rows 38 72 control binary variables 0 , 1 (where 0 stands disease , 1 stands control) in dataset. want assign colours red , blue for disease , control observations respectively.
my aim when graphically represent dataset, variables belong disease (or class 0) show red , control show blue in colour. how can achieve this?
cls = c(rep(0,37),rep(1,(72-37))) clr = c(rep("red",37),rep("blue",(72-37)))
when plot, can use color=clr
, etc.
Comments
Post a Comment