I'd trying to graph the frequency of observations over time. I have a dataset where hundreds of laws are coded 0-3. I'd like to know if outcomes 2-3 are occurring more often as time progresses. Here is a sample of mock data:
Data <- data.frame(
year = sample(1998:2004, 200, replace = TRUE),
score = sample(1:4, 200, replace = TRUE)
)
If i plot
plot(Data$year, Data$score)
I get a checkered matrix where every single spot is filled in, but I can't tell which numbers occur more often. Is there a way to color or to change the size of each point by the number of observations of a given row/year?
A few notes may help in answering the question:
1). I don't know how to sample data where certain numbers occur more frequently than others. My sample procedure samples equally from all numbers. If there is a better way I should have created my reproducible data to reflect more observations in later years, I would like to know how.
2). this seemed like it would be best to visualize in a scatter plot, but I could be wrong. I'm open to other visualizations.
Thanks!