I play with bubble drawing in R - the current project is a graph of a bubble diagram of political donations that has the following characteristics:
x-axis: size of donation, in ranges ie $10-$19, $20-29, $30-49, etc. y-axis: number of donations of that amount area of bubble: total amount of donations
I do not plan anything complicated, just something like:
symbols(amount_ranges,amount_occurrences, circles=sums)
The data is quite detailed, so there is a separate entry for each donation, and they need to be summed up to get the values โโI'm looking for.
For example, the data looks as follows (extraneous columns are deleted):
CTRIB_NAML CTRIB_NAMF CTRIB_AMT FILER_ID John Smith $49 123456789
It is not so difficult, but is there an easy way in R to count the number of occurrences of a certain value (for the y axis)? And add the amount of these donations (which is derived from the axes)? Or do I need to create a function that iterates through the data and compiles these numbers separately? Or pre-process the data in some way?
r
tchaymore
source share