I would like to generate a correlation plot with my "True" variable pairs with all of the rest (People variables). I am pretty sure this has been brought up somewhere but solutions I have found do not work for me.
library(ggplot2) set.seed(0) dt = data.frame(matrix(rnorm(120, 100, 5), ncol = 6) ) colnames(dt) = c('Salary', paste0('People', 1:5)) ggplot(dt, aes(x=Salary, y=value)) + geom_point() + facet_grid(.~Salary) Where I got error: Error: Column y must be a 1d atomic vector or a list.
I know one of the solutions is writing out all of the variables in y - which I am trying to avoid because my true data has 15 columns.
Also I am not entirely sure what do the "value", "variables" refer to in the ggplot. I saw them a lot in demonstrating codes.
Any suggestion is appreciated!




y = valuehas no meaning as there is novaluecolumn in yourdt. Are you trying to plot salary amounts against number of people in different groups?