I want to occasionally insert columns from different data frames (tables, matrices, or something else). For example, I have a tool table and a stan devs table. I want both to be inserted along with sd in parentheses for latex printing. I suspect there is a friendly plyr solution, but I canβt figure out how to work with two data frames (I tried to save the data as a list and use ldply, but this was my first attempt with the plyr list function, and it fell in flames.
Thanks in advance.
#========= #fake data #========= x<-mtcars[1:3,1:3] y<-mtcars[1:3,8:10] #========================== #A column pasting function #========================== meansd<-function(x, y){ x<-round(x, dig=2) y<-round(y, dig=2) paste(x, "(", y, ")", sep="") }
What i got.
DESIRED RESULTS No column names required. I don't care if returning is a matrix or a data framework.
16.46(0) 0(1) 1(4) 17.02(0) 0(1) 1(4) 18.61(1) 1(1) 1(4)
source share