What I miss about Pandas(Python) working on R is the way a DataFrame is exported to excel. In R, ftable shows tables similar as pandas multiindex DataFrame. When I use to_excel in pandas every row and column is ok in every cell even merge cells in column names if necesary.
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 spend a lot of time formatting (text to column, unquoting, merging, etc) in excel.
There is a way (package) in R to export ftable to excel without to make a lot of formatting things. Thanks in advance.