Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 206278

How to get the difference between data between columns?

$
0
0

![result table][1]

I am looking to get produce a new dataframe (or simply add another column) that gives the difference between start and stop

How might I go about doing this?

I tried this:

difference <- c(df$start, df$stop)

However, even though it produced an output, it was not correct.

This error pops up as well:

In Ops.factor(df$start, df$stop) : ‘-’ not meaningful for factors


Viewing all articles
Browse latest Browse all 206278

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>