bike2 <- read.table("bike_sharing_data.txt", sep="\t", header=TRUE)
bike1 <- read.table("bike_sharing_data.csv", sep=",", header=TRUE)
bike3 <- read.csv("bike_sharing_data.csv")
bike4 <- read.delim("bike_sharing_data.txt")
dim(bike1)
## [1] 17379 13
class(bike4$humidity)
## [1] "character"
bike1[6251, "season"]
## [1] 4
table(bike1$season)[4]
## 4
## 4232
#No R code needed
library(readr)
## Warning: package 'readr' was built under R version 4.5.2
bike_sharing_data <- read_csv("bike_sharing_data.csv")
## Warning: One or more parsing issues, call `problems()` on your data frame for details,
## e.g.:
## dat <- vroom(...)
## problems(dat)
## Rows: 17379 Columns: 13
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (2): datetime, sources
## dbl (11): season, holiday, workingday, weather, temp, atemp, humidity, winds...
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
sum(
bike_sharing_data$windspeed >= 40 &
bike_sharing_data$season %in% c(1, 4)
)
## [1] 46