2020年12月31日星期四

R, publication ready table from list data type

I am trying to make a table of my data using table1::table1 function and I can't seem to get it to work for my list of data.

I can get the below code to work as expected.

DF = list('A' = rnorm(100, mean = 1),            'B' = rnorm(100, mean = 2),            'C' = rnorm(100, mean = 3))  table1::table1(~A+B+C, data=DF, overall = 'List 1')  

I am trying to do the same thing as above but add the extra 'List 2' as the next column.

DF = NULL  DF[['List 1']] = list('A' = rnorm(100, mean = 1),            'B' = rnorm(100, mean = 2),            'C' = rnorm(100, mean = 3))    DF[['List 2']] = list('A' = rnorm(100, mean = 1),            'B' = rnorm(100, mean = 2),            'C' = rnorm(100, mean = 3))  

Does anyone have any suggestions or know of a better way to accomplish this?

https://stackoverflow.com/questions/65527031/r-publication-ready-table-from-list-data-type January 01, 2021 at 11:00AM

没有评论:

发表评论