R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

load("C:/Users/Steven/Downloads/Base_de_dados-master/Base_de_dados-master/Titanic.RData")

local({
  .Table <- xtabs(~Sexo+Sobreviveu+Classe, data=Titanic)
  cat("\nFrequency table:\n")
  print(.Table)
  cat("\nRow percentages:\n")
  print(rowPercents(.Table)) 
})
## 
## Frequency table:
## , , Classe = Tripulação
## 
##            Sobreviveu
## Sexo        Não sobreviveu Sobreviveu
##   Feminino               3         20
##   Masculino            670        192
## 
## , , Classe = Primeira
## 
##            Sobreviveu
## Sexo        Não sobreviveu Sobreviveu
##   Feminino               4        141
##   Masculino            118         61
## 
## , , Classe = Segunda
## 
##            Sobreviveu
## Sexo        Não sobreviveu Sobreviveu
##   Feminino              13         93
##   Masculino            154         25
## 
## , , Classe = Terceira
## 
##            Sobreviveu
## Sexo        Não sobreviveu Sobreviveu
##   Feminino             106         90
##   Masculino            422         88
## 
## 
## Row percentages:
## , , Classe = Tripulação
## 
##            Sobreviveu
## Sexo        Não sobreviveu Sobreviveu Total Count
##   Feminino            13.0       87.0   100    23
##   Masculino           77.7       22.3   100   862
## 
## , , Classe = Primeira
## 
##            Sobreviveu
## Sexo        Não sobreviveu Sobreviveu Total Count
##   Feminino             2.8       97.2   100   145
##   Masculino           65.9       34.1   100   179
## 
## , , Classe = Segunda
## 
##            Sobreviveu
## Sexo        Não sobreviveu Sobreviveu Total Count
##   Feminino            12.3       87.7   100   106
##   Masculino           86.0       14.0   100   179
## 
## , , Classe = Terceira
## 
##            Sobreviveu
## Sexo        Não sobreviveu Sobreviveu Total Count
##   Feminino            54.1       45.9   100   196
##   Masculino           82.7       17.3   100   510
load("C:/Users/Steven/Downloads/Base_de_dados-master/Base_de_dados-master/CARROS.RData")
CARROS <- within(CARROS, {
  Tipodecombustivel <- factor(Tipodecombustivel, labels=c('Gas','Alc'))
})
CARROS <- within(CARROS, {
  TipodeMarcha <- factor(TipodeMarcha, labels=c('Auto','Manual'))
})
Boxplot(Preco~Tipodecombustivel, data=CARROS, id=list(method="y"),col=c("red",
  "royalblue"))

## [1] "Porsche 914-2" "Ferrari Dino"
Boxplot(Preco~Tipodecombustivel, data=CARROS, id=list(method="y"),col=c("#efaa4f",
  "royalblue"))

## [1] "Porsche 914-2" "Ferrari Dino"
Boxplot(Preco~TipodeMarcha, data=CARROS, id=list(method="y"))

## [1] "Ford Pantera L" "Maserati Bora"
Boxplot(Preco~TipodeMarcha, data=CARROS, id=list(method="y"),col=c("#efaa4f",
  "royalblue"))

## [1] "Ford Pantera L" "Maserati Bora"
Boxplot(Kmporlitro~TipodeMarcha, data=CARROS, id=list(method="y"))

with(CARROS, plotMeans(Preco, Tipodecombustivel, error.bars="se", connect=FALSE))

par(bg="yellow")
with(CARROS, plotMeans(Preco, Tipodecombustivel, error.bars="se", connect=FALSE))

names(Titanic)
## [1] "Classe"     "Idade"      "Sexo"       "Sobreviveu"
mosaicplot(~ Classe+Idade+Sexo+Sobreviveu, data = Titanic, color = TRUE)

mosaicplot(~ Idade+Sexo+Sobreviveu, data = Titanic, color = TRUE)

mosaicplot(~ Sexo+Sobreviveu, data = Titanic, color = c("#efaa4f","royalblue"))