Create new column with rounded values I am trying to create a new column in this dataset. I would like to have rating to be 1, 2, 3, 4 or 5 instead of 1.25, 2.00, 3.75, ..., 5.00. 
Can you help me? The only solution I found is this

chocolate$Rat = gsub("1.25", "1", chocolate$Rating)


but I know it is not a good way to work. Is there something faster which can to the work efficiently?
Thanks
The R function is “round”. The default is to round to the nearest integer, which is what you want. The function takes vector inputs, so you can apply it to your column in one line instead of using a “for” loop.

Then you’ll tack in on to your original data in any number of ways, such as “expanded_data &lt;- data.frame(original_data, round(column))”.