This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#moda# | |
x<-c(3.0,5.8,5.6,4.8,5.1,3.6,5.5,4.7,5.7,5.0,5.9,5.7,4.4,5.4,4.2,5.3) | |
sort(x, decreasing=TRUE) | |
[1] 5.9 5.8 5.7 5.7 5.6 5.5 5.4 5.3 5.1 5.0 4.8 4.7 4.4 4.2 3.6 3.0 | |
y <- 5.7 | |
y | |
plot(x, col="blue", ylab="Eje Y", xlab="Eje X", main="Moda de datos") | |
points(y, col="brown") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#sd# | |
x<-c(3.0,5.8,5.6,4.8,5.1,3.6,5.5,4.7,5.7,5.0,5.9,5.7,4.4,5.4,4.2,5.3,0.3,0.14) | |
plot(x) | |
y<-sd(x) | |
y | |
plot(x, col="blue", ylab="Eje Y", xlab="Eje X", main="Desviacion estandar de datos") | |
points(y, col="purple") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#varianza# | |
x<-c(3.0,5.8,5.6,4.8,5.1,3.6,5.5,4.7,5.7,5.0,5.9,5.7,4.4,5.4,4.2,5.3,0.3,0.14) | |
plot(x) | |
k<-var(x) | |
k | |
plot(x, col="blue", ylab="Eje Y", xlab="Eje X", main="Varianza de datos") | |
points(k, col="green") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#median# | |
x<-c(3.0,5.8,5.6,4.8,5.1,3.6,5.5,4.7,5.7,5.0,5.9,5.7,4.4,5.4,4.2,5.3) | |
plot(x) | |
z<-median(x) | |
z | |
plot(x, col="blue", ylab="Eje Y", xlab="Eje X", main="Mediana de datos") | |
median(x) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#mean# | |
x<-c(3.0,5.8,5.6,4.8,5.1,3.6,5.5,4.7,5.7,5.0,5.9,5.7,4.4,5.4,4.2,5.3) | |
plot(x) | |
y<-mean(x) | |
y | |
plot(x, col="blue", ylab="Eje Y", xlab="Eje X", main="Media de datos") | |
points(y, col="red") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Gráfica de jitter# | |
install.packages("HistData") | |
library(HistData) | |
data(Galton) | |
plot(Galton) | |
plot(jitter(Galton$parent), Galton$child)) | |
plot(jitter(Galton$parent), Galton$child) | |
plot(jitter(Galton$parent), jitter(Galton$child)) | |
plot(jitter(Galton$parent), jitter(Galton$child), main="Grafica de funcion jitter") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Gráfica de girasol# | |
install.packages("HistData") | |
library(HistData) | |
data(Galton) | |
head(Galton) | |
sunflowerplot(Galton) | |
sunflowerplot(Galton, cex=.5, col="brown", seg.lwd=1.5, seg.col="purple", main="Grafica de girasol", xlab="Padres", ylab="Ninios") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Gráficas de burbuja# | |
crime <- read.csv("http://datasets.flowingdata.com/crimeRatesByState2005.tsv", header=TRUE, sep="\t") | |
symbols(crime$murder, crime$burglary, circles=crime$population) | |
radius <- sqrt( crime$population/ pi ) | |
symbols(crime$murder, crime$burglary, circles=radius) | |
symbols(crime$murder, crime$burglary, circles=radius, inches=0.35, fg="white", bg="orange", xlab="Murder Rate", ylab="Burglary Rate", main="Grafica de burbujas") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Gráficas de burbuja# | |
crime <- read.csv("http://datasets.flowingdata.com/crimeRatesByState2005.tsv", header=TRUE, sep="\t") | |
symbols(crime$murder, crime$burglary, circles=crime$population) | |
radius <- sqrt( crime$population/ pi ) | |
symbols(crime$murder, crime$burglary, circles=radius) | |
symbols(crime$murder, crime$burglary, circles=radius, inches=0.35, fg="white", bg="orange", xlab="Murder Rate", ylab="Burglary Rate") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Gráfica en .R points# | |
x<--10:10 | |
y<-x^2 | |
plot(x,y) | |
points(0, 30) | |
y2<-0.5*x^2 | |
plot(x,y2,type="p") | |
points(x,y,type="p") | |
plot(x,y, col="orange") | |
plot(x,y,pch=18, , main="Grafica en .R points") |
NewerOlder