[r] How can I divide one column of a data frame through another?

I wanted to divide one column by another to get the per person time how can I do this?I couldn't find anything on how you can divide.

Here is some data that I want to use

     min    count2.freq
263807.0    1582
196190.5    1016
586689.0    3479

In the end I want to add a third column like this that has the number from min / count2.freq

e.g 263808.0/1582 = 166.75

This question is related to r count

The answer is


Hadley Wickham

dplyr

packages is always a saver in case of data wrangling. To add the desired division as a third variable I would use mutate()

d <- mutate(d, new = min / count2.freq)