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:
bike <- read.csv('C:/Users/rosha/Downloads/datasets/bike.csv')
summary(bike)
## Date Rented.Bike.Count Hour Temperature
## Length:8760 Min. : 0.0 Min. : 0.00 Min. :-17.80
## Class :character 1st Qu.: 191.0 1st Qu.: 5.75 1st Qu.: 3.50
## Mode :character Median : 504.5 Median :11.50 Median : 13.70
## Mean : 704.6 Mean :11.50 Mean : 12.88
## 3rd Qu.:1065.2 3rd Qu.:17.25 3rd Qu.: 22.50
## Max. :3556.0 Max. :23.00 Max. : 39.40
## Humidity Wind.speed Visibility Dew.point.temperature
## Min. : 0.00 Min. :0.000 Min. : 27 Min. :-30.600
## 1st Qu.:42.00 1st Qu.:0.900 1st Qu.: 940 1st Qu.: -4.700
## Median :57.00 Median :1.500 Median :1698 Median : 5.100
## Mean :58.23 Mean :1.725 Mean :1437 Mean : 4.074
## 3rd Qu.:74.00 3rd Qu.:2.300 3rd Qu.:2000 3rd Qu.: 14.800
## Max. :98.00 Max. :7.400 Max. :2000 Max. : 27.200
## Solar.Radiation Rainfall Snowfall Seasons
## Min. :0.0000 Min. : 0.0000 Min. :0.00000 Length:8760
## 1st Qu.:0.0000 1st Qu.: 0.0000 1st Qu.:0.00000 Class :character
## Median :0.0100 Median : 0.0000 Median :0.00000 Mode :character
## Mean :0.5691 Mean : 0.1487 Mean :0.07507
## 3rd Qu.:0.9300 3rd Qu.: 0.0000 3rd Qu.:0.00000
## Max. :3.5200 Max. :35.0000 Max. :8.80000
## Holiday Functioning.Day
## Length:8760 Length:8760
## Class :character Class :character
## Mode :character Mode :character
##
##
##
#data documentation
Data include weather information (Temperature, Humidity, Windspeed, Visibility, Dewpoint, Solar radiation, Snowfall, Rainfall), the number of bikes rented per hour and date information. Attribute Information Date : year-month-day Rented Bike count - Count of bikes rented at each hour Hour - Hour of he day Temperature-Temperature in Celsius Humidity - % Windspeed - m/s Visibility - 10m Dew point temperature - Celsius Solar radiation - MJ/m2 Rainfall - mm Snowfall - cm Seasons - Winter, Spring, Summer, Autumn Holiday - Holiday/No holiday Functional Day - NoFunc(Non Functional Hours), Fun(Functional hours)
#goals/purpose
Currently Many big communities have adopted the use of rental bikes to improve transportation comfort. It is crucial to make the rental bikes accessible and available to the general public at the appropriate time since it reduces waiting. Eventually, maintaining a steady supply of rental bikes for the city emerges as a top priority. Predicting the number of bikes needed to maintain a steady supply of rental bikes at each hour’s interval is essential.
standard_deviation <- sd(bike$Humidity, na.rm= TRUE)
variation <- var(bike$Visibility, na.rm= TRUE)
summ <- sum(bike$Temperature)
print(standard_deviation)
## [1] 20.36241
print(variation)
## [1] 370027.3
print(summ)
## [1] 112854.4
plot(bike$Hour, bike$Humidity, main="Scatter Plot of X vs Y", xlab="Hour", ylab="Humidity")
hist(bike$Hour, main="Histogram of Values", xlab="Hour")
boxplot(bike$Visibility, main="Box Plot of Values")
pie(table(bike$Seasons), main="Pie Chart of Category")
result <- aggregate(bike$Humidity,by=list(bike$Seasons), mean)
result
## Group.1 x
## 1 Autumn 59.22848
## 2 Spring 58.77672
## 3 Summer 64.98143
## 4 Winter 49.74491
barplot(result$x, names.arg=result$Group.1, xlab="Season", ylab="Average Humidity", col=rainbow(6),
main="Season vs Humidity",border="black")