library(ggplot2) d <- data.frame(x=c(1,2,3), y=c(3,2,3), z = hs_z) d$x+d$y