Hello i am new to R programming and i am stuck with one problem. I would like to combine 2 dataframe into a new one in this way. First column of first dataframe, first column of second dataframe and then the third column of the new dataframe should be the difference between the 2 columns before, and iterate the process for all the columns of the dataframe ( they have same size of course). The crucial point is that the new columns should have their name unchanged.... this is where i get stuck. Please help meeee
i tried to iterate a for loop and combine through cbind but then i don't know how to leave the column names unchanged
Use the code
Explanation:
You said you have two datasets
data1anddata2, and a 3rd dataset which is the difference of the two datasets. Here is a quick way to go about itHaving the data above, to get the desired output we could simply do: