df <- read.csv("/Users/rohan/spaceship-titanic/train.csv")
library(kableExtra) #Flip light switch on for Kable
var_name <-colnames(df) #Variable Column Names
var_types_cs <- sapply(df, class) #Variable data type in terms of CS (Numeric,Character, Boolean...)
var_types_stats <-c("Qualitative" #unique ID label stored as a character
,"Qualitative" #Planet name label stored as character
,"Qualitative" #True or False label value stored as character
,"Qualitative" #Combination of Digits and numbers for description in Cabin Label
,"Qualitative" #Label for classifying destination
,"Quantitative: Continuous" #Non Integer value which is measurable numerically, age
,"Qualitative" #True or False label stored as character
,"Quantitative: Continuous" #Non Integer value of dollar amount which is measurable numerically
,"Quantitative: Continuous" #Non Integer value of dollar amount which is measurable numerically
,"Quantitative: Continuous" #Non Integer value of dollar amount which is measurable numerically
,"Quantitative: Continuous" #Non Integer value of dollar amount which is measurable numerically
,"Quantitative: Continuous" #Non Integer value of dollar amount which is measurable numerically
,"Qualitative" #Label for classifying passanger names
,"Qualitative" #True or False label stored as a character
)
var_measurement_level<- c("Nominal", #Qual and no order
"Nominal", #Qual and no order
"Nominal", #Qual and no order
"Nominal", #Qual and no order
"Nominal", #Qual and no order
"Ratio", #Quant and significant value of 0 years, meaning you cannot get lower than that threshold
"Nominal", #Qual and no order
"Ratio", #Quant and significant value of $0 spent, meaning you cannot get lower than that threshold
"Ratio", #Quant and significant value of $0 spent, meaning you cannot get lower than that threshold
"Ratio", #Quant and significant value of $0 spent, meaning you cannot get lower than that threshold
"Ratio", #Quant and significant value of $0 spent, meaning you cannot get lower than that threshold
"Ratio", #Quant and significant value of $0 spent, meaning you cannot get lower than that threshold
"Nominal", #Qual and no order
"Nominal" #Qual and no order
)
table <- data.frame("Variable Name" = var_name,#Column 1 of variable names
"R Data Type" = var_types_cs, #Column 2 of data types in terms of CS
"Statistical Data Type" = var_types_stats, #Column 3 of data types in terms of statistics
"Level of Measurement" = var_measurement_level, #Column 4 of levels of measurement
check.names = FALSE # Prevents modification of column names
)
kable(table, row.names = FALSE) #formats table through kableExtra package while only keeping column labels