Created the unfactor function

Note: passed R CMD CHECK