If running the code linearly, this bit of code to make the 'Title" column a factor (so we can make a box-plot),
> df.train$Title <- factor(df.train$Title,
c("Capt","Col","Major","Sir","Lady","Rev",
"Dr","Don","Jonkheer","the Countess","Mrs",
"Ms","Mr","Mme","Mlle","Miss","Master"))
will later cause an error when trying to reassign the grouped titles:
> df.train$Title <- changeTitles(df.train,
c("Capt", "Col", "Don", "Dr",
"Jonkheer", "Lady", "Major",
"Rev", "Sir"),
"Noble")
In `[<-.factor`(`*tmp*`, which(data$Title == honorific), value = c(13L, :
invalid factor level, NA generated