I have found an issue, that I was unable to understand. Can someone please point to an explanation?
In ggplot, if I use/don't use "$" with variable name , it gives different result. Please see the example below,
library(ggplot2)
df <- read.csv("pseudo_facebook.tsv", sep = '\t')
# Without $ sign
ggplot(data = df, aes(x = friend_count)) + geom_histogram(binwidth = 25) +
scale_x_continuous(limits = c(1, 1000), breaks = seq(0, 1000, 25)) +
facet_grid(~df$gender)
# With $ sign
ggplot(data = df, aes(x = df$friend_count)) + geom_histogram(binwidth = 25) +
scale_x_continuous(limits = c(1, 1000), breaks = seq(0, 1000, 25)) +
facet_grid(~df$gender)