Dummy codes in order to handle Categorical Variable
myCategoricalPredictor <- C(data$CategoricalPredictor, treatment)
model <- lm(data$OutcomeVariable ~ data$NumericPredictorVariable + myCategoricalPredictor)
? This is not always needed as R will do it for you
contrasts will give you the details of the dummy variable.
contrasts(myObject)
Red Blue
Green 0 0
Red 1 0
Blue 0 1