R

Asked • 08/15/19

How to substract a column by row?

I want to do an easy subtract in R, but I don't know how to solve it. I would like to know if I have to do a loop or if there is a function. I have a column with numeric variables, and I would like to subtract n by n-1. Time_Day Diff 10 10 15 5 45 30 60 15 Thus, I would like to find the variable "Diff".

1 Expert Answer

By:

Jacob I. answered • 08/27/19

Tutor
5 (19)

Experienced Data Science Professional and Python Programmer

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.