library(tidyverse)── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.4 ✔ readr 2.1.6
✔ forcats 1.0.1 ✔ stringr 1.6.0
✔ ggplot2 4.0.1 ✔ tibble 3.3.1
✔ lubridate 1.9.4 ✔ tidyr 1.3.2
✔ purrr 1.2.1
── 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
url <- "https://raw.githubusercontent.com/sinemkilicdere/Data607/refs/heads/main/data/product_sales.csv"
df <- read_csv(
file = url,
show_col_types = FALSE
)
glimpse(df)Rows: 15,000
Columns: 8
$ week <dbl> 2, 6, 5, 4, 3, 6, 4, 1, 5, 5, 3, 2, 5, 2, 5, 4, 2, 6…
$ sales_method <chr> "Email", "Email + Call", "Call", "Email", "Email", "…
$ customer_id <chr> "2e72d641-95ac-497b-bbf8-4861764a7097", "3998a98d-70…
$ nb_sold <dbl> 10, 15, 11, 11, 9, 13, 11, 10, 11, 11, 9, 9, 11, 10,…
$ revenue <dbl> NA, 225.47, 52.55, NA, 90.49, 65.01, 113.38, 99.94, …
$ years_as_customer <dbl> 0, 1, 6, 3, 0, 10, 9, 1, 10, 7, 4, 2, 2, 1, 1, 2, 6,…
$ nb_site_visits <dbl> 24, 28, 26, 25, 28, 24, 28, 22, 31, 23, 28, 23, 30, …
$ state <chr> "Arizona", "Kansas", "Wisconsin", "Indiana", "Illino…