data(package = "fpp3")
Data
You can find a overview of the data that is included in the textbook package fpp3 by running the following code:
# A tibble: 13 × 2
Item Title
<chr> <chr>
1 aus_accommodation Australian accommodation data
2 aus_airpassengers Air Transport Passengers Australia
3 aus_arrivals International Arrivals to Australia
4 bank_calls Call volume for a large North American commercial bank
5 boston_marathon Boston marathon winning times since 1897
6 canadian_gas Monthly Canadian gas production
7 guinea_rice Rice production (Guinea)
8 insurance Insurance quotations and advertising expenditure
9 prices Price series for various commodities
10 souvenirs Sales for a souvenir shop
11 us_change Percentage changes in economic variables in the USA.
12 us_employment US monthly employment data
13 us_gasoline US finished motor gasoline product supplied.
These are avaiable when the fpp3 package is loaded, i.e.
library(fpp3)
bank_calls
# A tsibble: 27,716 x 2 [5m] <UTC>
DateTime Calls
<dttm> <dbl>
1 2003-03-03 07:00:00 111
2 2003-03-03 07:05:00 113
3 2003-03-03 07:10:00 76
4 2003-03-03 07:15:00 82
5 2003-03-03 07:20:00 91
6 2003-03-03 07:25:00 87
7 2003-03-03 07:30:00 75
8 2003-03-03 07:35:00 89
9 2003-03-03 07:40:00 99
10 2003-03-03 07:45:00 125
# ℹ 27,706 more rows
To load a specific data set explicitly in your R environment:
data("bank_calls")
Other examples used in the videos and content on this website is available for download at github.com/holleland/BAN430/tree/master/data. You should also be able to load them directly into R using the raw link:
# CPI Norway
read.csv(
"https://raw.githubusercontent.com/holleland/BAN430/master/data/CPI_norway.csv", sep = ";") %>% head()
X Y.avg2 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov
1 2022 . 117.8 119.1 119.8 121.2 121.5 122.6 124.2 123.9 125.6 . .
2 2021 116.1 114.1 114.9 114.6 115.0 114.9 115.3 116.3 116.3 117.5 117.2 118.1
3 2020 112.2 111.3 111.2 111.2 111.7 111.9 112.1 112.9 112.5 112.9 113.2 112.4
4 2019 110.8 109.3 110.2 110.4 110.8 110.5 110.6 111.4 110.6 111.1 111.3 111.6
5 2018 108.4 106.0 107.0 107.3 107.7 107.8 108.5 109.3 108.9 109.5 109.3 109.8
6 2017 105.5 104.3 104.7 105.0 105.2 105.4 105.8 106.1 105.3 105.9 106.0 106.1
Dec
1 .
2 118.9
3 112.9
4 111.3
5 109.8
6 106.1
For excel files it is a bit less convenient, because you will need to download the file. But you can let R do that for you (if you insist).
<- function(url) {
loadExcel_url <- tempfile(fileext = ".xlsx")
temp_file download.file(url = url, destfile = temp_file, mode = "wb", quiet = TRUE)
::read_excel(temp_file)
readxl
}loadExcel_url("https://github.com/holleland/BAN430/blob/master/data/NorwayEmployment_15-74years_bySex.xlsx?raw=true")
# A tibble: 214 × 3
Sex Quarter `Employed persons (1 000 persons)`
<chr> <chr> <dbl>
1 Male 1996K1 1133
2 Male 1996K2 1152
3 Male 1996K3 1171
4 Male 1996K4 1161
5 Male 1997K1 1164
6 Male 1997K2 1189
7 Male 1997K3 1200
8 Male 1997K4 1189
9 Male 1998K1 1195
10 Male 1998K2 1214
# ℹ 204 more rows
The code above will save the file temporary in your computers temporary folder and load it into R from there. You could also adjust the code so that it stores the file in your working directory by adjusting the function.
<- paste0(getwd(), "/NorwayEmployment.xlsx") temp_file
But the easiest will maybe be to just download the files manually from github and save them in a data folder of your own.