library(tidyverse)
library(ggthemes)
library(skimr)
#library(rbokeh)
bodies <- read_csv("bodies.csv")
characters <- read_csv("characters.csv")
gliders <- read_csv("gliders.csv")
tires <- read_csv("tires.csv")
Data summary
Name bodies
Number of rows 40
Number of columns 7
_______________________
Column type frequency:
character 1
numeric 6
________________________
Group variables None

Variable type: character

skim_variable n_missing complete_rate min max empty n_unique whitespace
Vehicle 0 1 5 24 0 40 0

Variable type: numeric

Data summary
skim_variable n_missing complete_rate mean sd p0 p25 p50 p75 p100 hist
Speed 0 1 -0.02 0.36 -0.75 -0.25 0.00 0.25 0.50 ▅▇▅▇▅
Acceleration 0 1 -0.17 0.52 -1.00 -0.50 -0.25 0.25 0.75 ▇▇▇▇▆
Weight 0 1 -0.01 0.32 -0.50 -0.25 0.00 0.25 0.50 ▅▇▇▆▅
Handling 0 1 -0.06 0.38 -0.75 -0.50 0.00 0.25 0.50 ▇▃▆▇▃
Traction 0 1 0.07 0.37 -0.75 -0.06 0.00 0.31 0.75 ▂▃▇▅▆
Mini Turbo 0 1 -0.01 0.50 -1.00 -0.25 0.00 0.25 1.00 ▂▇▅▇▂
Name characters
Number of rows 32
Number of columns 14
_______________________
Column type frequency:
character 2
numeric 12
________________________
Group variables None

Variable type: character

skim_variable n_missing complete_rate min max empty n_unique whitespace
Character 0 1 4 15 0 32 0
Class 0 1 5 6 0 3 0

Variable type: numeric

Data summary
skim_variable n_missing complete_rate mean sd p0 p25 p50 p75 p100 hist
Speed 0 1 3.38 0.89 2.25 2.75 3.25 4.25 4.75 ▇▂▃▃▂
Speed (Water) 0 1 3.38 0.89 2.25 2.75 3.25 4.25 4.75 ▇▂▁▆▂
Speed (Air) 0 1 3.38 0.89 2.25 2.75 3.25 4.25 4.75 ▇▂▁▆▂
Speed (Ground) 0 1 3.38 0.89 2.25 2.75 3.25 4.25 4.75 ▇▂▁▆▂
Acceleration 0 1 2.67 0.46 2.00 2.25 2.75 3.00 3.25 ▇▃▂▆▆
Weight 0 1 3.41 0.93 2.25 2.75 3.25 4.25 4.75 ▇▂▃▂▃
Handling 0 1 4.25 0.54 3.25 4.12 4.25 4.75 4.75 ▃▂▁▇▇
Handling (Water) 0 1 3.62 0.89 2.25 2.75 3.75 4.25 4.75 ▇▃▂▆▆
Handling (Air) 0 1 3.62 0.89 2.25 2.75 3.75 4.25 4.75 ▇▃▂▆▆
Handling(Ground) 0 1 3.62 0.89 2.25 2.75 3.75 4.25 4.75 ▇▃▂▆▆
Traction 0 1 3.92 0.46 3.25 3.50 4.00 4.25 4.50 ▇▃▂▆▆
Mini Turbo 0 1 2.49 0.43 1.75 2.25 2.50 2.75 3.00 ▆▃▇▇▇
Name gliders
Number of rows 10
Number of columns 14
_______________________
Column type frequency:
character 2
numeric 12
________________________
Group variables None

Variable type: character

skim_variable n_missing complete_rate min max empty n_unique whitespace
Body 0 1 4 13 0 10 0
Type 0 1 5 12 0 2 0

Variable type: numeric

Data summary
skim_variable n_missing complete_rate mean sd p0 p25 p50 p75 p100 hist
Speed 0 1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 ▁▁▇▁▁
Speed (Water) 0 1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 ▁▁▇▁▁
Speed (Air) 0 1 0.12 0.13 0.00 0.00 0.12 0.25 0.25 ▇▁▁▁▇
Speed (Ground) 0 1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 ▁▁▇▁▁
Acceleration 0 1 0.12 0.13 0.00 0.00 0.12 0.25 0.25 ▇▁▁▁▇
Weight 0 1 -0.12 0.13 -0.25 -0.25 -0.12 0.00 0.00 ▇▁▁▁▇
Handling 0 1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 ▁▁▇▁▁
Handling (Water) 0 1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 ▁▁▇▁▁
Handling (Air) 0 1 0.12 0.13 0.00 0.00 0.12 0.25 0.25 ▇▁▁▁▇
Handling(Ground) 0 1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 ▁▁▇▁▁
Traction 0 1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 ▁▁▇▁▁
Mini Turbo 0 1 0.12 0.13 0.00 0.00 0.12 0.25 0.25 ▇▁▁▁▇
Name tires
Number of rows 18
Number of columns 13
_______________________
Column type frequency:
character 1
numeric 12
________________________
Group variables None

Variable type: character

skim_variable n_missing complete_rate min max empty n_unique whitespace
Body 0 1 4 13 0 18 0

Variable type: numeric

skim_variable n_missing complete_rate mean sd p0 p25 p50 p75 p100 hist
Speed 0 1 -0.01 0.31 -0.50 -0.20 0.00 0.25 0.50 ▃▃▇▅▂
Speed (Water) 0 1 0.11 0.42 -0.50 -0.38 0.25 0.50 0.50 ▆▁▂▅▇
Speed (Air) 0 1 0.24 0.20 0.00 0.00 0.25 0.44 0.50 ▇▁▇▁▆
Speed (Ground) 0 1 -0.07 0.35 -0.50 -0.44 0.00 0.25 0.50 ▇▅▆▆▃
Acceleration 0 1 0.24 0.39 -0.25 0.00 0.25 0.25 1.00 ▇▇▁▁▃
Weight 0 1 -0.21 0.27 -0.50 -0.50 -0.25 0.00 0.25 ▇▃▁▇▂
Handling 0 1 -0.06 0.30 -0.75 -0.19 0.00 0.19 0.25 ▂▁▃▇▅
Handling (Water) 0 1 -0.10 0.34 -0.75 -0.38 0.00 0.19 0.25 ▂▃▁▇▅
Handling (Air) 0 1 -0.01 0.29 -0.75 0.00 0.00 0.19 0.25 ▂▁▁▇▃
Handling(Ground) 0 1 -0.06 0.30 -0.75 -0.19 0.00 0.19 0.25 ▂▁▃▇▅
Traction 0 1 -0.10 0.54 -1.00 -0.50 -0.12 0.38 0.75 ▂▅▇▁▆
Mini Turbo 0 1 0.40 0.58 0.00 0.00 0.00 0.75 1.50 ▇▁▂▁▂

The variables that we will be looking at the most are Speed, Acceleration, handling, and traction. They are all numeric variables. There are also those types of data but with regards to air water and ground but for this project We won’t be looking at them.

There is no missing data.

#change class type to show that there different types of light, medium, and heavy
characters <- characters %>% mutate(Class = ifelse(Speed == 2.25, "light1", ifelse(Speed == 2.75, "light2", ifelse(Speed == 3.25, "medium1", ifelse(Speed == 3.75, "medium2",ifelse(Speed == 4.25, "heavy1", ifelse(Speed == 4.75, "heavy2", Class )))))))
#removing character with the same data
CharByClass <- characters %>% distinct(Class, .keep_all = TRUE)

#removing gliders with the same data 
GliderByType <- gliders %>% distinct(Type, .keep_all = TRUE)

By doing this we see that there are two different types of light, medium and heavy characters. and two different types of gliders. I did this so that there will be less combinations with the same value when I find the different combinations.

The light1 Characters are

characters %>% ggplot(aes(x = fct_relevel(Class, "light1", "light2", "medium1", "medium2", "heavy1", "heavy2"))) +
  geom_bar(fill = "red") +
  labs(title = "Count of the weights of Charaters",
       x = "Weight class",
       y = "freqency") 

#rename columns so that they are easier to use later
colnames(CharByClass) <- c('Character', 'Class', 'Speed', 'SpeedWater', 'SpeedAir', 'Speedground' , 'Acceleration', 'Weight', 'Handling', 'HandlingWater', 'HandlingAir', 'HandlingGround', 'Traction', 'MiniTurbo')
colnames(GliderByType) <- c('Body', 'Type', 'Speed', 'SpeedWater', 'SpeedAir', 'Speedground' , 'Acceleration', 'Weight', 'Handling', 'HandlingWater', 'HandlingAir', 'HandlingGround', 'Traction', 'MiniTurbo')
colnames(bodies) <- c('Vehicle', 'Speed','Acceleration', 'Weight', 'Handling', 'Traction', 'MiniTurbo')
colnames(tires) <- c('Body', 'Speed', 'SpeedWater', 'SpeedAir', 'Speedground' , 'Acceleration', 'Weight', 'Handling', 'HandlingWater', 'HandlingAir', 'HandlingGround', 'Traction', 'MiniTurbo')
#combo of character and gliders
combos <- expand_grid(CharByClass, GliderByType, bodies, tires, .name_repair = "unique")

#adding up the speed, acceleration, handling, weight, traction and Mini turbo boost, of all the variables in the combination. 
combos <- combos %>% 
  mutate(TotalSpeed = Speed...3 + Speed...17 + Speed...30 + Speed...37, 
         TotalAcceleration = Acceleration...7 + Acceleration...21 + Acceleration...31 + Acceleration...41,
         TotalWeight = Weight...8 + Weight...22 + Weight...32 + Weight...42,
         TotalHandling = Handling...9 + Handling...23 + Handling...33 + Handling...43,
         TotalTraction = Traction...13 + Traction...27 + Traction...34 + Traction...47,
         TotalMiniTurbo = MiniTurbo...14 + MiniTurbo...28 + MiniTurbo...35 + MiniTurbo...48)

#Taking out the data that we want to use to make a smaller data set that is easier to use
ClCombos <- combos %>% select(Class, Type, Vehicle, Body...36, TotalSpeed, TotalAcceleration, TotalWeight, TotalTraction, TotalMiniTurbo)

Data dictionary

dataDictionary <- tibble(Variable = colnames(ClCombos),
  Description = c("weight Class", 
                "Type of Glider", 
                "Kart used", 
                "Tires used", 
                "The total speed stat for the combination",
                "The total Acceleration stat for the combination",
                "The total Weight stat for the combination",
                "The total Traction stat for the combination",
                "The total Miniturbo stat for the combination"))
flextable::flextable(dataDictionary, cwidth = 2)

plot

ClCombos %>% ggplot(aes(x = TotalSpeed,
                      y = TotalAcceleration)) +
  geom_point() +
  labs(title = "Speed Vs. Acceleration of different combinations",
       x = "Speed",
       y = "Acceleration") +
  theme_bw()

ClCombos %>% ggplot(aes(x = TotalWeight,
                      y = TotalAcceleration)) +
  geom_point() +
  labs(title = "Weight Vs. Acceleration of different combinations",
       x = "Weight",
       y = "Acceleration") +
  theme_bw()

ClCombos %>% ggplot(aes(x = TotalWeight,
                      y = TotalSpeed)) +
  geom_point() +
  labs(title = "Weight Vs. Speed of different combinations",
       x = "Weight",
       y = "Speed") +
  theme_bw()

From what I found while playing it seems like you want carts with good acceleration for courses with lots of turns, more than you want speed.

Data sets from: https://www.kaggle.com/datasets/barelydedicated/mariokart8?select=bodies.csv