Import the bike sharing CSV using base R.
bike <- read.csv("bike_sharing_data.csv")
Find the number of rows and columns.
dim(bike)
## [1] 17379 13
Check how R stores the humidity variable.
class(bike$humidity)
## [1] "character"
Retrieve the season value in row 6251.
bike$season[6251]
## [1] 4
Count observations for each season and retrieve winter (season 4).
table(bike$season)
##
## 1 2 3 4
## 4242 4409 4496 4232
sum(bike$season == 4)
## [1] 4232
Count observations with windspeed of at least 40 during winter (4) or spring (1).
sum(bike$season %in% c(4, 1) & bike$windspeed >= 40)
## [1] 46