Psst! Check what courses we have in our offer, and get them all here to save $727. Act fast–this deal is available only 3/14–3/21.


If you try to replace one of the elements in a factor variable with a value that does not belong to a valid level, R will replace the designated element with NA and issue a warning. In other words, if you try entering anything other than "N" or "Y" in the phone_factor column, the value will end up as NA.


Try replacing the first row of the phone_factor value with "Yes". Observe what happens.

Stuck? Here's a hint!

You should choose the first row and select the phone_factor column:

houses[1, ]$phone_factor <- ...