I have the following code to generate a dataset in R. However, I want the actual precise values for each x value in the chart and cant figure out how to generate these values. Here is the code I have:
x <- c("CF", "CH", "CJ", "CE", "CN", "EC", "EN", "EJ", "AB", "BA", "KO", "OD", "DL", "HG")
px = c(0.08, 0.10, 0.06, 0.20, 0.04, 0.15, 0.02, 0.10, 0.025, 0.025, 0.05, 0.05, 0.05, 0.05)
draws = sample(x, size = 1000, replace = TRUE, prob = px)
barplot(height=table(draws))
How can I get the precise frequencies for each of the x values (i.e. CF, CH, CE, etc.)?