Está en la página 1de 2

> datos<-read.csv(file="./data.

csv",header=TRUE,sep=";",dec=",")

> datos

> stem(datos$cadmiun) para hacer diagrama de arboles

> stem(datos[,4])

> stem(datos$copper)

> stem(datos[,5])

Histograma

> hist(datos[,4])

> hist(datos$cadmiun)

> hist(datos$cadmiun, breaks =15)

> hist(datos$cadmiun, breaks =100)

> histinfo<-hist(datos[,4], breaks =15)

> histinfo

> plot(histinfo$mids, histinfo$density)

Frecuencias acumu

> max(datos$cadmiun)

[1] 18.1

> min(datos$cadmiun)

> sqrt(155)

[1] 12.4499

> (18.1-0.2)/12

[1] 1.491667

> breaks <- seq(0.2, 18.1, by=1.49)

> breaks

> breaks <- seq(0.2, 18.1, by=1.4916)

> breaks

> cadmiun.cut =cut(datos$cadmiun, breaks, right=FALSE)

> cadmiun.cut

> xout <- as.data.frame(table(cadmiun.cut))

> xout <- transform(xout, cumFreq = cumsum(Freq), relative = prop.table(Freq))

> xout

cadmiun.cut Freq cumFreq relative

1 [0.2,1.69) 65 65 0.422077922

2 [1.69,3.18) 44 109 0.285714286


3 [3.18,4.67) 12 121 0.077922078

4 [4.67,6.17) 4 125 0.025974026

5 [6.17,7.66) 9 134 0.058441558

6 [7.66,9.15) 8 142 0.051948052

7 [9.15,10.6) 4 146 0.025974026

8 [10.6,12.1) 5 151 0.032467532

9 [12.1,13.6) 1 152 0.006493506

10 [13.6,15.1) 1 153 0.006493506

11 [15.1,16.6) 0 153 0.000000000

12 [16.6,18.1) 1 154 0.006493506

> hist(datos$cadmiun)

> hist(datos$cadmiun, main="Mayra", xlab="Cd (ppm)", xlim=c(0,20), col="darkmagenta",freq=FALSE)

> hist(datos$cadmiun, main="Mayra", xlab="Cd (ppm)",ylab="Frecuencia", xlim=c(0,20), col="darkmagenta")

> hist(datos$cadmiun)

> hist(datos$cadmiun, main="Mayra", xlab="Cd (ppm)", xlim=c(0,20), col="darkmagenta",freq=FALSE)

> hist(datos$cadmiun, main="Mayra", xlab="Cd (ppm)",ylab="Frecuencia", xlim=c(0,20), col="darkmagenta")

> hist(datos$cadmiun, main="Mayra", xlab="Cd (ppm)",ylab="Frecuencia", xlim=c(0,20), col="yellow")

> hist(datos$cadmiun, main="Mayra", xlab="Cd (ppm)",ylab="Frecuencia", xlim=c(0,20), col="yellow",


border="blue", breaks=15)

> hist(datos$cadmiun, main="Mayra", xlab="Cd (ppm)",ylab="Frecuencia", xlim=c(0,20), col="yellow", border="red",


breaks=10)

> plot(ecdf(datos$cadmiun))

> breaks = seq(0.2, 18.1, by=1.2)

> cadmiun.cut = cut(datos$cadmiun, breaks, right=FALSE)

> cadmiun.freq = table(cadmiun.cut)

> cumfreq0 = c(0, cumsum(cadmiun.freq))

> plot(breaks, cumfreq0, main="Valores Cadmiun", xlab="Cd (ppm)", ylab="Valores Acumulados Cd")

> jpeg("cadmiun.jpg")

> plot(breaks, cumfreq0, main="Valores Cadmiun", xlab="Cd (ppm)",

+ ylab="Valores Acumulados Cd")

> dev.off()

windows

También podría gustarte