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

create a string from first 2 elements in dataframe and add to new column in R

$
0
0

I think this is fairly simple, say I have a data frame

> vadata 
    va1 va2
1   a   c
2   b   d

I want to create a new column va3 = "a-c" and "b-d" for all rows in vadata and append to vadata?

vadata is of type dataframe.

Is there an easy to way do this in r?


Viewing all articles
Browse latest Browse all 201839

Trending Articles



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