 Thank you for watching this tutorial on Forest Plotter. My name is Ali Mudayma. I'm from Department of Fancology University of Cambridge. In this talk, I'm going to go through the Forest Plotter package. As indicated by the name, it is used to draw the forest plot. So before we jump into the functions of the package, here is the main data set we've got. And this is a confidence interval. And this is a risk of bias with some decorations. And here are some x-axis and the arrow label. And this is the model information from the meta-alanses. And also, if you look at this forest plot closely, you will find out this is more like an Excel spreadsheet or a data frame in R. Everything is aligned by rows and by columns. You can usually think of this as maybe a data frame. And you can get rid of all the decorations. So we can do that. If we can rid of all the decorations, we will find out this is a really simple data frame. So this is the basic idea behind this forest plotter package. So it will receive a data set used as a layout. And it will present everything. And the confidence interval will be drawn on these columns. And with some decorations, we'll be added. Contexting itself, you decide the height and the width of the column or the row. So you can manipulate everything. Like you can change the layout by providing multiple lines or have a line break or with some spaces, controls of the width of the column. There's two functions in this forest plotter package. One is the main function to draw the forest plot. The first one is you need to provide the layout data set and the point estimation lower and upper bounds of the confidence interval and the size. And this one is important. This is the which column you want to draw your confidence interval. So basically, this is the main thing. And another one is the forest theme, which is used for change the theme of the forest plot. You can change the graphical parameters of confidence interval, legend, x-axis, et cetera, but everything you can imagine. So before we draw a forest plot, we need to prepare a data set. You can read this meta-analysis data set from the forest plotter package. After you read in the data set, we are going to provide a column, which will be used to fit to plot the confidence interval. And here we have a 20 based on that column. You can increase the number of space to have a wider column, and which means you will have a wider confidence interval. And then next up is the data set you are going to use as a basic layout. After we select that, rename the variable and it may change to some data manipulation. And one thing you need to remember is if there's some missing data set, it will be drawn as a layer. So in order to avoid that, you can change all the missing values as a corrector. So get rid of that and changes that to blank. Here's a prepared data set. You have seen this before and this column will be used to draw the confidence interval. And then we define our theme for the forest plot with a white background and change the summary color to black and to other thing. And then we pass our prepared data set here and the point estimation, confidence interval and change the size and indicating which one, which row is the summary row, which is like indicating total effect. And column eight will be used to draw the confidence interval and passing other things too. Then this is the final output. As we can see here, comparing to the data set before, this is the data set we got. The only thing we have done is change the background color to white and edit this confidence interval here. This is the basic forest plot. We can stop here, but there's other things you can do with this package. There are some post-editing function. One is edit plot. You can use this to edit the text or background of confidence interval as graphical parameters. You can add text or insert text to a specific cell. Also you can add border to a specific cell or add a graph to plot. So let's first start with editing a plot. So one thing we want to do is change the text to bold and change the color of the text or change the color of the confidence interval, which is the total effect. And then edit the forest and then do some other editing like text alignment. We want to have the risk bias to centrally aligned. So this is the output. We can see we change this one to the bold one and have a background color. Also this one to blue and then centrally aligned this risk of bias. Also, and after this has been done, we want to add something more. Add some more headers here. And here we want to add as ratio indicating what it is. And here we want to add a risk of bias. And maybe later we are going to report some more information here. So next thing we can do is add some text or add or insert some text with add text or insert text. You can define where you want to add like as a row and a column. And if you want to add it to the header or whatever you want to add. One thing I want to mention is insert text. It will create a new row. So you need to be very careful. After I did some text, this is our final output. Here we have added this text. And here this is the text. This is the text we have added here. And here we have added new, inserted new row here. Everything will be go to the next row. After doing that, we want to add some border here and the border line in this row. And here to separate them. So we can use add border to that, column nine to 14 have a long row, long line. And the one for the risk of bias here as a bottom risk of bias. This is the edited plot. Also we want to do further editing. We want to have a green color at the back of here with a circle. And here for the yellow and here with the red. And also add some text here. So in order to do that, we can use add a crop. So this is adding a rectangle as a bias to separate everything out with the dotted line. And here is how we can do to add some background grub like a circle grub to which row and which column we want to add. This is a final output. So here we can see there's a dotted rectangle grub added, been added here. And the circle grub added here with different color. And also we want to add some text here. What we can do is use other package to have a different color grid text package can be used grid text package has a flexibility using can create a rich text grub. So this is how it's done. This is a text we want to pass and this is a function. And the other parameters will be passed to this function. And after that, we can see here, this is just text been edited. So a great thing about this package is it supports different colors. You can have different colors and text here. And this is basically everything for the first part. But this package can do more than that. Whatever you have multiple confidence, there are column with multiple groups. So in order to do that, you can pass a point estimation with the list. So here's the first one, we are going to the column three and the next one, we are going to column five. And the next one, we are going to column three again. And the next one, we are going to column five. So this one and this one, GP one and GP three will be drawn on the same column, column three, they will be different group. And this one and group two and group four will be drawn to column five. So there will be two groups in one cell. So this is the final output we have here. So we have two columns and double column. In each cell, we have two groups. So this is basically everything about this package. So the great thing about this package is it has very few dependency, only it only depends on G table and the grid extra. And it returns a G tree. So you can save this plot using gg save. And the seeming function is separated with gg seem. So you have control over all the elements also for a start. And also after you have done, you can do some post editing to manipulate the figure as a table. But the drawback of the cons of this package is because it's everything is determined by the content you have provided. So you cannot change the scale of the figure. So the width and the height is determined by the content. There's one function though, you can use this function to extract the width and the height of the plot and then pass it to with whatever function you want to save the plot. So thank you everyone for listening. This is basically everything. If you have any question, please send me an email or file an issue in the GitHub or any suggestion will be very welcome. Thank you very much.