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 puntos# | |
plot(x,y, main="Grafica de puntos en .R", sub="Grafica en R", xlab="Eje x", ylab="Eje y", col="purple") | |
#Gráfica en linea# | |
plot(x,y, main="Grafica de linea en .R", sub="Grafica en R", xlab="Eje x", ylab="Eje y", col="purple", type="l") | |
#Gráfica de histograma# | |
plot(x,y, main="Grafica de histograma en .R", sub="Grafica en R", xlab="Eje x", ylab="Eje y", col="purple", type="h") |
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
#Hum con cnt# | |
par(mfrow=c(1,4)) | |
data%>% filter(season==1) %>% select(hum,cnt) %>%plot(ylab="Demanda", xlab="Normalized humidity", main="Primavera") | |
data%>% filter(season==1) %>% select(hum,cnt) %>% max() | |
data %>% filter(cnt == max(cnt)) %>% select(hum) | |
points(0.755833,7836,col="red") | |
text(0.75,7500,"Demanda mas alta") | |
# cnt:7836, hum:0.755833# | |
data%>% filter(season==2) %>% select(hum,cnt) %>%plot(ylab="Demanda", xlab="Normalized humidity", main="Verano") |
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
#CNT año 1# | |
par(mfrow=c(2,1)) | |
data<-tbl_df(day) | |
data%>%filter(yr==1)%>%group_by(season)%>%summarise(demanda=sum(cnt)) | |
data%>%filter(yr==1)%>%group_by(season)%>%summarise(demanda=sum(cnt))%>%select(demanda) | |
data%>%filter(yr==1)%>%group_by(season)%>%summarise(demanda=sum(cnt)/100000)%>%select(demanda)%>%as.matrix()%>%as.vector()%>%max() | |
data%>%filter(yr==1)%>%group_by(season)%>%summarise(demanda=sum(cnt)/100000)%>%select(demanda)%>%as.matrix()%>%as.vector() | |
data%>%filter(yr==1)%>%group_by(season)%>%summarise(demanda=sum(cnt)/100000)%>%select(demanda)%>%as.matrix()%>%as.vector()%>%barplot(names.arg=c("Primavera", "Verano", "Otono", "Invierno"), col=c("yellow", "red", "green", "blue"), main="Temporada con la demanda mas alta 2012", ylab="Demanda", xlab="Temporada") | |
#En la grafica se puede observar que la temporada del a;o que tiene mas demanda es la numero 3, que es de los dias del 21 de Junio al 22 de septiembre# |
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
#Temperatura que se siente# | |
par(mfrow=c(2,4)) | |
data%>% filter(season==1) %>% select(atemp,cnt) %>%plot(ylab="Demanda", xlab="Feeling Temperature", main="Primavera") | |
data%>% filter(season==1) %>% select(atemp,cnt) %>% max() | |
data %>% filter(cnt == max(cnt)) %>% select(atemp) | |
points(0.505046,7836,col="red") | |
text(0.3,7836,"Demanda mas alta") | |
#cnt:7836, atemp:0.505046# | |
data%>% filter(season==2) %>% select(atemp,cnt) %>% plot(ylab="Demanda", xlab="Feeling Temperature", main="Verano") |
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
day<-read.csv("day.csv") | |
hour<-read.csv("hour.csv") | |
#Demandas Promedio# | |
#1 Demanda por dia de la semana# | |
data<-tbl_df(day) | |
data%>% group_by(weekday) %>% summarise(prom=mean(cnt))%>%select(prom)%>%as.matrix()%>%as.vector()%>%barplot() | |
data%>% group_by(weekday) %>% summarise(prom=mean(cnt))%>%select(prom)%>%as.matrix()%>%as.vector()%>%barplot(names.arg=c("Mon","Tues","Wed","Thur","Frid","Sat","Sun")) | |
data%>% group_by(weekday) %>% summarise(prom=mean(cnt))%>%select(prom)%>%as.matrix()%>%as.vector()%>%barplot(names.arg=c("Mon","Tues","Wed","Thur","Frid","Sat","Sun"), col=c("yellow","pink","blue","red","green","orange","purple")) | |
data%>% group_by(weekday) %>% summarise(prom=mean(cnt)/100)%>%select(prom)%>%as.matrix()%>%as.vector()%>%barplot(names.arg=c("Mon","Tues","Wed","Thur","Frid","Sat","Sun"), col=c("yellow","pink","blue","red","green","orange","purple")) | |
data%>% group_by(weekday) %>% summarise(prom=mean(cnt)/100)%>%select(prom)%>%as.matrix()%>%as.vector()%>%barplot(names.arg=c("Mon","Tues","Wed","Thur","Frid |
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
ener<-subset(day,mnth=="1") | |
feb<-subset(day,mnth=="2") | |
mar<-subset(day,mnth=="3") | |
abr<-subset(day,mnth=="4") | |
may<-subset(day,mnth=="5") | |
jun<-subset(day,mnth=="6") | |
jul<-subset(day,mnth=="7") | |
agos<-subset(day,mnth=="8") | |
sept<-subset(day,mnth=="9") | |
oct<-subset(day,mnth=="10") |
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
library(dplyr) | |
day<-read.csv("day.csv") | |
hour<-read.csv("hour.csv") | |
#1 Dias de la semana# | |
par(mfrow=c(1,2), oma=c(3,1,4,0) | |
data<-tbl_df(day) | |
day %>%filter(yr==0) %>% select(cnt) %>%summary() | |
day %>% filter(yr==0) %>% select(weekday, cnt) %>%plot(col="orange", main="Bicicletas por dias de la semana, year 1", ylab="Numero de bicicletas alquiladas", xlab="Dias de la semana") | |
day %>% filter(yr==1) %>% select(weekday, cnt) %>%plot(col="orange", main="Bicicletas por dias de la semana, year 2", ylab="Numero de bicicletas alquiladas", xlab="Dias de la semana") |
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
#ATEMP# | |
par(mfrow=c(2,4)) | |
data%>% filter(season==1) %>% select(atemp,cnt) %>%plot(ylab="Demanda", xlab="Feeling Temperature", main="Primavera") | |
data%>% filter(season==1) %>% select(atemp,cnt) %>% max() | |
data %>% filter(cnt == max(cnt)) %>% select(atemp) | |
points(0.505046,7836,col="red") | |
text(0.3,7836,"Demanda mas alta") | |
#cnt=7836, atemp=0.505046# | |
data%>% filter(season==2) %>% select(atemp,cnt) %>% plot(ylab="Demanda", xlab="Feeling Temperature", main="Verano") |
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
#HUM CON DEMANDA# | |
par(mfrow=c(1,4)) | |
data%>% filter(season==1) %>% select(hum,cnt) %>%plot(ylab="Demanda", xlab="Normalized humidity", main="Primavera") | |
data%>% filter(season==1) %>% select(hum,cnt) %>% max() | |
data %>% filter(cnt == max(cnt)) %>% select(hum) | |
points(0.755833,7836,col="red") | |
text(0.75,7500,"Demanda mas alta") | |
# cnt=7836, hum=0.755833# | |
data%>% filter(season==2) %>% select(hum,cnt) %>%plot(ylab="Demanda", xlab="Normalized humidity", main="Verano") |
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
Demanda del viento | |
par(mfrow=c(1,1)) | |
data%>%filter(yr==0)%>%select(windspeed,cnt)%>%plot(main="Demanda y viento", ylab="Demanda", | |
xlab="Velocidad del viento", col="blue", type="h") |