Está en la página 1de 2

# Carga de datos ----------------------------------------------------------

# Diamantes
datos <- read.csv("diamonds.csv")
datos1 <- datos[,-1]
colnames(datos1)=c("Quilate","Calidad_corte","Color","Claridad","Profundidad(%)","T
abla(%)","Precio","Longitud(x)","Ancho(y)","Profundidad(z)")

Quilates<- datos1$Quilate
Calidad_corte <- datos1$Calidad_corte
Color <- datos1$Color
Claridad <- datos1$Claridad
Precio <- datos1$Precio
Longitud<- datos1$`Longitud(x)`
Ancho<- datos1$`Ancho(y)`
Profundidad<- datos1$`Profundidad(z)`

# AN�LISIS DESCRIPTIVO ----------------------------------------------------

# variables cuantitativas

# Quilates
summary(Quilates)
hist(Quilates)
boxplot(Quilates)

# Precio
summary(Precio)
hist(Precio)
boxplot(Precio)

# Medidas
summary(Longitud)
summary(Ancho)
summary(Profundidad)
summary(datos1$`Tabla(%)`)
summary(datos1$`Profundidad(%)`)

# Relaci�n Precio-Quilates
plot(Quilates,Precio)

# variables cualitativas

# Calidad del corte


levels(Calidad_corte)=c("Fair","Good","Very Good","Premiun","Ideal")
n <- summary(Calidad_corte)
barplot(n)
pie(n,col = c("green","red","pink","yellow","orange"))

# Color del diamante


levels(Color)=c("J","I","H","G","F","E","D")
m<- summary(Color)
barplot(m)
pie(m,col=c("yellow","green","skyblue","blue","purple","red","orange"))

# Claridad
levels(Claridad)=c("I3","I2","I1","SI2","SI1","VS2","VS1","VVS2","VVS1","IF","FL")
u <- summary(Claridad)
barplot(u)

http://www.diamondiberica.com/curso-de-formacion-sobre-el-diamante.html

También podría gustarte