converting columns of data frame to factor

Excellent. Please do continue to seek guidance here, but please identify your posts as homework. Most people will probably try to guide you understanding a bit more in their answers.

Also please consult this