I launched the library (tidyverse) and started work on the Cyclists dataset in Google Data Analytics Capstone.
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.3 ✔ readr 2.1.4
## ✔ forcats 1.0.0 ✔ stringr 1.5.0
## ✔ ggplot2 3.4.4 ✔ tibble 3.2.1
## ✔ lubridate 1.9.3 ✔ tidyr 1.3.0
## ✔ purrr 1.0.2
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
cyclistic_capstone <- read.csv("C:\\Users\\ADMIN\\OneDrive\\JOB\\personal stuff\\learning centre\\STATISTTICS\\google data analytics\\CAPSTONE\\202308-divvy-tripdata\\202308-divvy-tripdata.csv")
View(cyclistic_capstone)
Once I had imported the csv, I arranged the start times from beginning to finish, and then wrote the new csv to my computer.
library(dplyr)
cyclistic_capstone_arranged <- cyclistic_capstone %>% arrange(desc(started_at))
View(cyclistic_capstone_arranged)
write.csv(cyclistic_capstone_arranged, "C:\\Users\\ADMIN\\OneDrive\\JOB\\personal stuff\\learning centre\\STATISTTICS\\google data analytics\\CAPSTONE\\202308-divvy-tripdata\\cyclistic_capstone_arranged.csv", row.names = FALSE)
I checked the memberships (on member_casual column) to see who are more: members vastly outnumber casuals.
ggplot(cyclistic_capstone_arranged, aes(x = member_casual)) +
geom_bar()
I checked the combined data from the January and March spreadsheets, imported it into r and labelled the data frame as combined data;
combined_data <- read.csv("C:\\Users\\ADMIN\\OneDrive\\JOB\\personal stuff\\learning centre\\STATISTTICS\\google data analytics\\CAPSTONE\\csv for bigquery\\2combined_january_march_2023_cyclists - bq-results-20231021-215839-1697925541157.csv")
View(combined_data)
combined2 <- as.numeric(combined_data$ride_length)
## Warning: NAs introduced by coercion
View(combined_data$ride_length)
View(combined2)
ggplot(combined_data, aes(x = member_casual)) +
geom_bar()
I decided to check which bikes are most popular. electric bikes win this race by a landslide, classic bikes come second. docked bikes are hardly ever used
ggplot(combined_data, aes(x = rideable_type)) +
geom_bar()