R bar chart

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

R bar chart

farshad goudarzian
Hello.
Here I attach a microsoft excel data base file and plot image to illustrate
my question.



my code:

ggplot(concretedata, aes(Company, Concrete, fill=
Type))+geom_bar(stat="identity")

As per the attachment plot, the bar chart for different parameters
(Concrete, Company and Type) is presented, but I dont know how to label
each area of my bar plot.

for example, the bottom left area of my chart should show the sum of
concrete provide by company A with type of C30 (16000 m3)
 or the top right area of my plot should present the total concrete volume
of company B with type of C25. (13000 m3)
but I dont know how to show the total concrete of each area

I know  the command is "geom_text", but it doesnt show the sum of concrete
volume, it shows all the numbers of concrete on top of each other.

thanks
best regards
______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: R bar chart

Rui Barradas
Hello,

There is no attached file, R-help is doesn't allow many file types.
Try reposting with the extension .txt or post the output of


dput(head(dataset, 20))


directly in your e-mail.

Hope this helps,

Rui Barradas

Às 10:58 de 07/09/19, farshad goudarzian escreveu:

> Hello.
> Here I attach a microsoft excel data base file and plot image to illustrate
> my question.
>
>
>
> my code:
>
> ggplot(concretedata, aes(Company, Concrete, fill=
> Type))+geom_bar(stat="identity")
>
> As per the attachment plot, the bar chart for different parameters
> (Concrete, Company and Type) is presented, but I dont know how to label
> each area of my bar plot.
>
> for example, the bottom left area of my chart should show the sum of
> concrete provide by company A with type of C30 (16000 m3)
>   or the top right area of my plot should present the total concrete volume
> of company B with type of C25. (13000 m3)
> but I dont know how to show the total concrete of each area
>
> I know  the command is "geom_text", but it doesnt show the sum of concrete
> volume, it shows all the numbers of concrete on top of each other.
>
> thanks
> best regards
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.