Quantcast
Channel: Matching rownumber and column name of a data frame with values of another data frame - Stack Overflow
Browsing latest articles
Browse All 3 View Live

Answer by IRTFM for Matching rownumber and column name of a data frame with...

I think using a two-column matrix as an argument to "[" would be considerably faster if this were a problem of any size. See ?"[" ofor more information on this strategy:samp_df[ cbind(samp2_df$sis_str,...

View Article



Answer by Ronak Shah for Matching rownumber and column name of a data frame...

I am not sure if there is a better way but one way to do this is by using mapply. We create a row-column pair value to be extracted form samp_df where the row value is samp2_df$sis_str and the column...

View Article

Matching rownumber and column name of a data frame with values of another...

I have a sample data framesamp_df <- data.frame(x1=c(1,3,5,7,9),x2=c(2,4,6,8,10))> samp_df x1 x21 1 22 3 43 5 64 7 85 9 10I have another data frame which contains variable str and sis_strsamp2_df...

View Article
Browsing latest articles
Browse All 3 View Live




Latest Images