We use ggplot geom_segment to produce patient movement timelines (TICL charts) like the one below. Once the plot is in word once the plot is in word, I have been manually adding on tables of extra information like the one on the right-hand side below. Is there a way to code for a side table like this in R please? A quick google has shown me it has been done with forest plots (Forest plots in R (ggplot) with side table | R-bloggers). Would it work with plots like the ones below?
A raster is an image that is split up into its component parts, which makes it easier to convert to other formats.
The xmin, ymin, xmax and ymax arguments are for setting the position of the table in the ggplot space.
Setting them to infinity allows the table to take up the whole plotting space.
Then to combine the plot and converted table:
# Put the figure and table together:
final_figure <- cowplot::plot_grid(mytimelineplot,
mytimelinetablegg,
nrow = 1,
ncol = 2,
rel_heights = c(1, 1))
This function allows you to specify the way that tables and figures are presented together, by specifying the number of rows, columns and the relative height of the two figures.