Introdução

Aqui vou colocar os primeiros gráficos.

# carregar do excel
library(readxl)
BasesEstados <- read_excel("C:/Users/Cristiane/Dropbox/Mestrado/Estatística aplicada à engenharia I/Base_de_dados-master/BasesEstados.xlsx")


# carregar do csv
library(readr)
FifaData <- read_csv("C:/Users/Cristiane/Dropbox/Mestrado/Estatística aplicada à engenharia I/Base_de_dados-master/FifaData.csv", 
                     col_types = cols(Club = col_character()))

# carregar do formato R
load("C:/Users/Cristiane/Dropbox/Mestrado/Estatística aplicada à engenharia I/Base_de_dados-master/CARROS.RData")

Aqui vou continuar escrevendo…

summary(CARROS$Kmporlitro)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   10.40   15.43   19.20   20.09   22.80   33.90
summary(FifaData$Nationality)
##    Length     Class      Mode 
##     17588 character character
summary(BasesEstados$PIB)
##      Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
## 7.314e+06 2.945e+07 8.083e+07 1.627e+08 1.695e+08 1.409e+09
summary(CARROS$Tipodecombustivel)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##  0.0000  0.0000  0.0000  0.4375  1.0000  1.0000
summary(CARROS$TipodeMarcha)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##  0.0000  0.0000  0.0000  0.4062  1.0000  1.0000
class(CARROS$Tipodecombustivel)
## [1] "numeric"
class(CARROS$TipodeMarcha)
## [1] "numeric"
class(FifaData$Nationality)
## [1] "character"
# COMO TRANSFORMAR DE QUANTITATIVA PARA QUANTITATIVA NOMINAL?

CARROS$Tipodecombustivel <- as.factor(CARROS$Tipodecombustivel)
CARROS$TipodeMarcha <- as.factor(CARROS$TipodeMarcha)
FifaData$Nationality <- as.factor(FifaData$Nationality)

CARROS$Tipodecombustivel_2 <-ifelse(CARROS$Tipodecombustivel=="0","Gasolina","Alcool")

class(CARROS$Tipodecombustivel_2)
## [1] "character"
CARROS$Tipodecombustivel_2 <- as.factor(CARROS$Tipodecombustivel_2)

Aqui vou continuar escrevendo…

Tabela_combustivel <- table(CARROS$Tipodecombustivel_2)

Tabela_combustivel # Abs
## 
##   Alcool Gasolina 
##       14       18
prop.table(Tabela_combustivel)*100 #Rel
## 
##   Alcool Gasolina 
##    43.75    56.25
pie(Tabela_combustivel)

pie(Tabela_combustivel,col = c("red",'blue'))

pie(Tabela_combustivel,col = c("skyblue",'royalblue'))

pie(Tabela_combustivel,col = c("gray6",'thistle1'))

pie(Tabela_combustivel,col = c("#e0bf48",'#e04880'),main = "Meu primeiro Gráfico no R!!!!")

barplot(Tabela_combustivel,col = c("red","blue"),main = "Meu segundo gráfico no R!",ylim = c(0,20))