We can use the abs() function to change the negative numbers to positive in R. For example, if we have the vector x containing negative numbers, we can change them to positive numbers by typing abs(x) in R.