This will handle all the columns; it assumes the ones you want to start
with are in column 2 through the end:
> library(dplyr)
> df1 <- read.table(text = "ID A B
+ 1 1 2
+ 1 0 3
+ 25 NA
+ 2 1 3
+ 3
You can use 'dplyr':
> library(dplyr)
> df1 <- read.table(text = "ID A B
+ 1 1 2
+ 1 0 3
+ 25 NA
+ 2 1 3
+ 3 1 4
+ 4 NA NA
+ 4 0 1
+ 4
> On Apr 23, 2016, at 9:46 PM, Saba Sehrish via R-help
> wrote:
>
> Hi
>
>
> I have two data frames as shown below (second one is obtained by aggregating
> rows of similar IDs in df1.). They both have similar number of columns but
> rows of df2 are lesser than rows
Hi
I have two data frames as shown below (second one is obtained by aggregating
rows of similar IDs in df1.). They both have similar number of columns but rows
of df2 are lesser than rows of df1.
df1:
ID A B
1 1 2
1 0 3
2
4 matches
Mail list logo