-1
Hello. I need to create the two charts below in this exact way. Certain adjustments, for example:
- the creation of a value of 7 in the x-axis, which has been omitted;
- the horizontal axis with traces of each value;
- the rotated label of each bar in the second chart;
- the grid lines of the chart background, relative to each value of the y-axis and arrows of the axes;
Chart 1:
What I’ve done so far:
Acidentes_ATA <- read_excel("~/R/PROVA MAURI/Acidentes ATA.xlsx")
View(Acidentes_ATA)
dput(Acidentes_ATA)
structure(list(Acidentes = c(3, 5, 4, 0, 4, 4, 4, 1, 4, 2, 4,
3, 8, 6, 4, 4, 1, 4, 1, 3, 3, 1, 2, 2, 6, 0, 2, 1, 3, 2), Ano = c(1977,
1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988,
1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003, 2004, 2005, 2006)), row.names = c(NA,
-30L), class = c("tbl_df", "tbl", "data.frame"))
frequencia_acidentes <- table(Acidentes_ATA$Acidentes)
barplot(frequencia_acidentes, ylab="Frequency", xlab="Number of Accidents", ylim=c(0, 10), col="skyblue1", space=0, main="Fatal Commercial Airplane Accidents per Year (1977-2006)")
barplot(dbinom(0:12, 11000000, 0.0000004), ylab="Probability", xlab="Number of Accidents", xlim=c(0,13), ylim=c(0,0.25), col="skyblue1", space=0)
Welcome to Stackoverflow! Unfortunately, this question cannot be reproduced by anyone trying to answer it. Please take a look at this link (mainly in the use of function
dput
) and see how to ask a reproducible question in R. So, people who wish to help you will be able to do this in the best possible way.– Marcus Nunes
Edited. Many thanks and pardon the stupidity.
– Marcos Trotta