I would like to make a series of histograms from columns in a dataframe where I look at the frequency of column A (a text descriptor.) depending upon the value of column B (a number). I would like to change the cutoff of value B and make a series of histograms to see what the distributions look like.
right now I am using:
x <- data[data$B> 10,]
y <- table(x$A)
hist(y)
and I could run this for a number of values of B. However,I would like to have a one liner like this:
hist(table(data$A where data$B > 10))
but I can’t get the syntax right. Anyone have an suggestions?
Simply subset
data$ainstead ofdata: