##Análisis exploratorio base de datos Toyota Corola La base de datos de Toyota describe el comportamiento de 10 atributos y de 1464 registros. Se descargo desde kaggle

BD<- read.csv("D:/Descargas/ToyotaCorolla2.csv")
summary(BD)
##      Price            Age              KM           FuelType        
##  Min.   : 4350   Min.   : 1.00   Min.   :     1   Length:1436       
##  1st Qu.: 8450   1st Qu.:44.00   1st Qu.: 43000   Class :character  
##  Median : 9900   Median :61.00   Median : 63390   Mode  :character  
##  Mean   :10731   Mean   :55.95   Mean   : 68533                     
##  3rd Qu.:11950   3rd Qu.:70.00   3rd Qu.: 87021                     
##  Max.   :32500   Max.   :80.00   Max.   :243000                     
##        HP           MetColor        Automatic             CC      
##  Min.   : 69.0   Min.   :0.0000   Min.   :0.00000   Min.   :1300  
##  1st Qu.: 90.0   1st Qu.:0.0000   1st Qu.:0.00000   1st Qu.:1400  
##  Median :110.0   Median :1.0000   Median :0.00000   Median :1600  
##  Mean   :101.5   Mean   :0.6748   Mean   :0.05571   Mean   :1567  
##  3rd Qu.:110.0   3rd Qu.:1.0000   3rd Qu.:0.00000   3rd Qu.:1600  
##  Max.   :192.0   Max.   :1.0000   Max.   :1.00000   Max.   :2000  
##      Doors           Weight    
##  Min.   :2.000   Min.   :1000  
##  1st Qu.:3.000   1st Qu.:1040  
##  Median :4.000   Median :1070  
##  Mean   :4.033   Mean   :1072  
##  3rd Qu.:5.000   3rd Qu.:1085  
##  Max.   :5.000   Max.   :1615

Graficos de las variables

A continuacion se realiza un funcion para poder evaluar cada atributo de variable e identifar si es numerio o tipo caracter. A los datos numericos se les reportara con un histograma, y a los datos tipos caracter se les reportara como un diagrama de pie

BDN <- NULL
BDC <- NULL
dimension <-dim(BD)
par(mfrow=c(2,dimension[2]/2))

#############################################################################
###################### exploracion de los datos #############################
for(j in 1:dimension[2]) {
  if(is.numeric(BD[,j]) == "TRUE") {
    texto <- paste('analisis del atributo  ',colnames(BD)[j])
    hist(BD[,j],col=j, main = texto)
    
  } else {    
    texto <- paste('analisis del atributo  ',colnames(BD)[j])
    pie(table(BD[,j]), main = texto)
    }
}

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:

summary(cars)
##      speed           dist       
##  Min.   : 4.0   Min.   :  2.00  
##  1st Qu.:12.0   1st Qu.: 26.00  
##  Median :15.0   Median : 36.00  
##  Mean   :15.4   Mean   : 42.98  
##  3rd Qu.:19.0   3rd Qu.: 56.00  
##  Max.   :25.0   Max.   :120.00

Including Plots

You can also embed plots, for example:

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.