Im new to R. I am trying a script to draw a tally plot or dot histogram.What I wanted was to make a chart that replaced the bars with dots, the number of dots in each column being equal to the frequency. I want to use the $mids as the x-values in a regular plot. The y-values would come from the $counts data. A frequency of 3 would get plotted three times, at y = 1, y = 2 and y = 3.
I made a histogram with
hist(mydata)
When I attempted to make a tally plot, I got the same code in the console.
hg = hist(mydata, plot = FALSE)
hg = hist(mydata, plot = FALSE)
I was expecting several elements:
hg$mids
[1] 3.5 4.5 5.5 6.5 7.5 8.5 9.5
hg$counts
[1] 1 0 3 3 2 2 1
Diana Rodriguez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.