Displaying 3 results from an estimated 3 matches for "sum_data".
Did you mean:
sim_data
2018 Jan 15
5
barplot that displays sums of values of 2 y colums grouped by different variables
...>
edm 62 27 <br>
the resulting plot should have city as the x-axis, 2 bars per city, 1
representing the sum of "n" in that city, the other the sum of "y" in
that city.
If possible also show the sum in each bar as a label?
I aggregated the data into sums like this:
sum_data <- aggregate(. ~ City,data=raw_data,sum)
this gave me the sums per city as I wanted but for some reason 1 of the
cities is missing in the output.
Using this code for the plot:
ggplot(sum_data,aes(x = City,y = n)) + geom_bar(aes(fill = y),stat =
"identity",position = "dodge&qu...
2018 Jan 15
0
barplot that displays sums of values of 2 y colums grouped by different variables
...ing plot should have city as the x-axis, 2 bars per city, 1
> representing the sum of "n" in that city, the other the sum of "y" in that
> city.
>
> If possible also show the sum in each bar as a label?
>
> I aggregated the data into sums like this:
>
> sum_data <- aggregate(. ~ City,data=raw_data,sum)
>
> this gave me the sums per city as I wanted but for some reason 1 of the
> cities is missing in the output.
>
> Using this code for the plot:
>
> ggplot(sum_data,aes(x = City,y = n)) + geom_bar(aes(fill = y),stat =
> "ide...
2018 Jan 15
0
barplot that displays sums of values of 2 y colums grouped by different variables
...t;>> representing the sum of "n" in that city, the other the sum of "y" in that
>>> city.
>>>
>>> If possible also show the sum in each bar as a label?
>>>
>>> I aggregated the data into sums like this:
>>>
>>> sum_data <- aggregate(. ~ City,data=raw_data,sum)
>>>
>>> this gave me the sums per city as I wanted but for some reason 1 of the
>>> cities is missing in the output.
>>>
>>> Using this code for the plot:
>>>
>>> ggplot(sum_data,aes(x = City,...