What I missed about Pandas (Python) running on R is a way to export a DataFrame to excel. In R, ftable shows tables similar to the pandas multiindex DataFrame. When I use to_excel in pandas, each row and column is approved in each cell, even if it is necessary to combine the cells in the column names.
In R, I tried write.ftable with write.table
df = data.frame(a = c(1:6), b = rep(c('G1','G2'),3), c = rep(c('A','D','F'),2), d = c('F','F','F','F','M','M')) df2 = ftable(xtabs(a~b+c+d, df), row.vars = 1) write.table(write.ftable(df2))
But I need to spend a lot of time formatting (text to column, unquoting, merging, etc.) in excel.
In R there is a way (package) to export ftable to excel without doing a lot of formatting. Thanks in advance.
r export-to-excel
Diego
source share