0

I made a table using flextable package, but when I go to write it I'm given 7 different duplicate slides. Oddly enough, the issue began happening after I added something in to transpose the table, so I'm not sure if that might be the problem.

df
# transpose df
fooData.T <- t(df[,2:ncol(df)])

# sets the column headings from the first column in the original table
colnames(fooData.T) <- t(df[,1])

# push column values to row names, select which columns to keep
as.data.frame(fooData.T) %>%
  rownames_to_column(var = " ") %>%
  flextable(col_keys = c(" ", "West","East"))

I'm not sure why it's duplicating, but I thought maybe a work around could be just to delete these slides using something similar to.

walk(rep(1, max(slides)), ~remove_slide(template_ppt, index = .))

The issue is I would have to read in the ppt after it's been made so kind of redundant. Is there a way I can include a write argument that only lets you write at max once to the master ppt?

  • It would be easier to help you if you provide [a minimal reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) including a minimal "working" example of your code and a snippet of your data or some fake data so that others can reproduce your issue. – stefan Apr 13 '23 at 16:55

0 Answers0