You are assigning your plot to the variable "p" - could it be that you are not printing "p" to your console? A script may look something like this:
library(tidyverse)
p = ggplot(mtcars, aes(x = mpg, y = wt)) +
geom_point() +
theme_dark()
p = p + aes(color = drat) + scale_color_continuous(low = "white", high = "red")
p