Use R in a jupyter notebook?

Machine-Learning
Author

Young Frank

Published

April 20, 2024

This notebook is writtten in jupyter!

library(ggplot2)
library(tidyverse)
-- Attaching core tidyverse packages ------------------------ tidyverse 2.0.0 --
v dplyr     1.1.0     v readr     2.1.4
v forcats   1.0.0     v stringr   1.5.0
v lubridate 1.9.2     v tibble    3.1.8
v purrr     1.0.1     v tidyr     1.3.0
-- Conflicts ------------------------------------------ tidyverse_conflicts() --
x dplyr::filter() masks stats::filter()
x dplyr::lag()    masks stats::lag()
i Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
df = readr::read_csv('data/store-sales-time-series-forecasting/train.csv')
Rows: 3000888 Columns: 6
-- Column specification --------------------------------------------------------
Delimiter: ","
chr  (1): family
dbl  (4): id, store_nbr, sales, onpromotion
date (1): date

i Use `spec()` to retrieve the full column specification for this data.
i Specify the column types or set `show_col_types = FALSE` to quiet this message.
df |> head()
A tibble: 6 x 6
id date store_nbr family sales onpromotion
<dbl> <date> <dbl> <chr> <dbl> <dbl>
0 2013-01-01 1 AUTOMOTIVE 0 0
1 2013-01-01 1 BABY CARE 0 0
2 2013-01-01 1 BEAUTY 0 0
3 2013-01-01 1 BEVERAGES 0 0
4 2013-01-01 1 BOOKS 0 0
5 2013-01-01 1 BREAD/BAKERY 0 0