Skip to content

Box-plot generation inhibits later commands #3

@drewbo

Description

@drewbo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions