Re: [R] replacing then summing by values from another dataframe

2015-08-11 Thread Gerrit Eichner
Hello, Xianming, I have changed your (particular) data structure: use matrices because you have only numeric scores and effects, use NA instead of -1 as missing value (as usual), don't use columns for ids or row/column names (except for the easy of reading the data structures), increase your s

Re: [R] replacing then summing by values from another dataframe

2015-08-10 Thread PIKAL Petr
R-help@r-project.org > Subject: [R] replacing then summing by values from another dataframe > > [I might have sent the following request to a wrong email address - > 'r-help-requ...@r-project.org'] > > Hi, > > > > I have two data frame dat1 and dat2. > > &g

[R] replacing then summing by values from another dataframe

2015-08-10 Thread Xianming Wei
[I might have sent the following request to a wrong email address - 'r-help-requ...@r-project.org'] Hi, I have two data frame dat1 and dat2. dat1 <- data.frame(pid = paste('C', 1:5, sep = ''), m1 = c(2, 2, 1, -1, 0),