Skip to content

Instantly share code, notes, and snippets.

@DATAUNIRIO
Created February 28, 2024 15:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DATAUNIRIO/9875662bd5b404cbc6ffd35c7501d033 to your computer and use it in GitHub Desktop.
Save DATAUNIRIO/9875662bd5b404cbc6ffd35c7501d033 to your computer and use it in GitHub Desktop.
library(dplyr)
percentual <- CARROS %>%
pull(TipodeMarcha) %>%
table() %>%
prop.table()*100
percentual <- round(percentual,digits = 1)
rotulo <- paste0(percentual,"%")
#GRÁFICO DE BARRA
bp<- CARROS %>%
pull(TipodeMarcha) %>%
table() %>%
barplot(ylab="Frequência",col=c("red","blue"),main="Gráfico 1")
text(bp, 0, rotulo,cex=1,pos=3,col = "white")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment