Description Usage Format Source Examples
The Indian Premier League played by teams representing different cities in India from 2008 to 2016.
1 |
A tibble with 8560 rows and 11 variables.
years representing IPL season
match codes
name of batting team
name of bowling team
innings of the match
overs of the inning
number of wickets in each over
number of balls with no runs in an over
Runs for each over
run rate for each over
https://www.kaggle.com/josephgpinto/ipl-data-analysis/data
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | data(cricket)
library(tsibble)
library(dplyr)
library(ggplot2)
# convert data set to a tsibble ----
cricket_tsibble <- cricket %>%
mutate(data_index = row_number()) %>%
as_tsibble(index = data_index)
# set the hierarchy of the units in a table ----
hierarchy_model <- tibble::tibble(
units = c("index", "over", "inning", "match"),
convert_fct = c(1, 20, 2, 1)
)
# Compute granularities ----
cricket_tsibble %>%
create_gran("over_inning",
hierarchy_model)
# Visualise distribution of runs across granularities ----
cricket_tsibble %>%
filter(batting_team %in% c("Mumbai Indians",
"Chennai Super Kings"))%>%
prob_plot("inning", "over",
hierarchy_model,
response = "runs_per_over",
plot_type = "lv")
|
sh: 1: timedatectl: Permission denied
Error in file(con, "r") : cannot open the connection
In addition: Warning messages:
1: In system("timedatectl", intern = TRUE) :
running command 'timedatectl' had status 126
2: In file(con, "r") : cannot open file '/etc/timezone': Permission denied
Attaching package: ‘dplyr’
The following objects are masked from ‘package:stats’:
filter, lag
The following objects are masked from ‘package:base’:
intersect, setdiff, setequal, union
# A tsibble: 8,560 x 12 [1]
season match_id batting_team bowling_team inning over wicket dot_balls
<dbl> <dbl> <chr> <chr> <dbl> <dbl> <dbl> <dbl>
1 2008 2 Chennai Sup… Kings XI Pu… 1 1 0 4
2 2008 2 Chennai Sup… Kings XI Pu… 1 2 0 2
3 2008 2 Chennai Sup… Kings XI Pu… 1 3 1 4
4 2008 2 Chennai Sup… Kings XI Pu… 1 4 0 3
5 2008 2 Chennai Sup… Kings XI Pu… 1 5 0 3
6 2008 2 Chennai Sup… Kings XI Pu… 1 6 0 3
7 2008 2 Chennai Sup… Kings XI Pu… 1 7 1 1
8 2008 2 Chennai Sup… Kings XI Pu… 1 8 1 3
9 2008 2 Chennai Sup… Kings XI Pu… 1 9 0 1
10 2008 2 Chennai Sup… Kings XI Pu… 1 10 0 2
# … with 8,550 more rows, and 4 more variables: runs_per_over <dbl>,
# run_rate <dbl>, data_index <int>, over_inning <fct>
Joining, by = c("inning", "over")
Joining, by = c("inning", "over")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.