I think this is a simple question for most but I am new to r and was hoping someone could help.
How can I create a new factor variable for levels of a variable (e.g. 0 = no, 1= yes). Then how do I put this into a new data frame?
So far I have been playing with the 'select' and 'mutate' functions but cannot get somewhere that I can create a correlation plot with the variable.
Thanks in advance! I slammed my laptop shut too many times over this!
You can do like this:
Read this carefully: https://github.com/rstudio/cheatsheets/raw/master/factors.pdf