Posted on:

07 Apr 2023

0

Age varaible still glued after running the code in the class

The following code was meant to solve the glued age variable:

tb.separated$age <- str_replace_all(tb.separate$age, "0" , "0")

tb.separated$age <- str_replace_all(tb.separate$age, "15" , "15")

tb.separated$age <- str_replace_all(tb.separate$age, "25" , "25")

tb.separated$age <- str_replace_all(tb.separate$age, "35" , "35")

tb.separated$age <- str_replace_all(tb.separate$age, "45" , "45")

tb.separated$age <- str_replace_all(tb.separate$age, "55" , "55")

tb.separated$age <- str_replace_all(tb.separate$age, "65" , "65-100")

tb.separated

However when I type and execute the above code, the age column still has glued values.

Please assist.

0 answers ( 0 marked as helpful)

Submit an answer