I have this example and was trying to diagnose why it doesn't.
df = data.table(one = rnorm(50),
two = rnorm(50),
thr = rnorm(50))
So for this data table, I want to plot histograms of two columns within a loop. This is done with the following.
these_vars = c("one","two")
for(var in these_vars){
df[,..var] %>% ggplot(., aes_string(var)) +
geom_histogram() + ggtitle(var)
}
However, this doesn't seem to work as the plots aren't rendered. Can anyone help diagnose the issue with this little process.