To create a new variable or to transform an old variable into a new one, usually, is a simple task in R. The common function to use is newvariable