# install.packages(c("rmarkdown","knitr"))
## Question 4
bike_txt_A <- read.table("bike_sharing_data.txt", sep = "\t", header = TRUE)
bike_csv_B <- read.table("bike_sharing_data.csv", sep = ",", header = TRUE)
bike_txt_C <- read.delim("bike_sharing_data.txt")
bike_csv_D <- read.csv("bike_sharing_data.csv")
bike <- bike_txt_A
## Question 5
dim(bike)
## [1] 17379 13
## Question 6
str(bike$humidity)
## chr [1:17379] "81" "80" "80" "75" "75" "75" "80" "86" "75" "76" "76" "81" ...
class(bike$humidity)
## [1] "character"
## Question 7
bike[6251, "season"]
## [1] 4
## Question 8
table(bike$season)
##
## 1 2 3 4
## 4242 4409 4496 4232
sum(bike$season == 1)
## [1] 4242
## Question 10
high_wind <- subset(bike, windspeed >= 11.2 & season %in% c(1, 2))
nrow(high_wind)
## [1] 4834