bike_sharing_data<- read.csv("bike_sharing_data.csv")
5) Number of Rows and Columns (Total Number of Observations and
Variables)
nrow(bike_sharing_data)
## [1] 17379
ncol(bike_sharing_data)
## [1] 16
6) The data type of humidity perceived by R
str(bike_sharing_data)
## 'data.frame': 17379 obs. of 16 variables:
## $ datetime : chr "1/1/2011 0:00" "1/1/2011 1:00" "1/1/2011 2:00" "1/1/2011 3:00" ...
## $ season : int 1 1 1 1 1 1 1 1 1 1 ...
## $ holiday : int 0 0 0 0 0 0 0 0 0 0 ...
## $ workingday: int 0 0 0 0 0 0 0 0 0 0 ...
## $ weather : int 1 1 1 1 1 2 1 1 1 1 ...
## $ temp : num 9.84 9.02 9.02 9.84 9.84 ...
## $ atemp : num 14.4 13.6 13.6 14.4 14.4 ...
## $ humidity : chr "81" "80" "80" "75" ...
## $ windspeed : num 0 0 0 0 0 ...
## $ casual : int 3 8 5 3 0 0 2 1 1 8 ...
## $ registered: int 13 32 27 10 1 1 0 2 7 6 ...
## $ count : int 16 40 32 13 1 1 2 3 8 14 ...
## $ sources : chr "ad campaign" "www.yahoo.com" "www.google.fi" "AD campaign" ...
## $ X : logi NA NA NA NA NA NA ...
## $ X.1 : logi NA NA NA NA NA NA ...
## $ X.2 : chr "for peak hours" "filter data: numerical approach" "show data through a plot" "" ...
class(bike_sharing_data$humidity)
## [1] "character"
7) Value of season in row 6251
bike3[6251, "season"]
## [1] 4
8) How many observations have the season winter?
season_table <- table(bike3$season)
season_table["4"]
## 4
## 4232
10) High wind threshold
high_wind_threshold <- 36
high_wind_obs <- subset(bike_sharing_data,
windspeed >= high_wind_threshold &
(season == "4" | season == "2"))
num_high_wind_obs <- nrow(high_wind_obs)