<p>A quick look at the code for forestplot shows that geom_effect is what needs to be modified. If you add a value for fatten changes the size of the shapes in the the figure (but not in the legend), or a value for size will change the shape, line and legend sizes (add to not geom_effect not to the aes layer)</p>
<p>This may be easier said than done as forestplot also seems to call an unexposed function (function quo_is_null). A couple of simple hacks are possible; copy and make your own forestplot in the default environment and remove the call to the function (it seems to just check if pvalue is set), or change the environment of the &quot;new&quot; forestplot to ggforestplot</p>
<pre><code>envorionment(forestplot) &lt;- envornment(ggforestplot::forestplot)
</code></pre>
<p>There may be other less awkward methods, but this will work. Fatten changed to size 6 which is massive.</p>
<pre><code>forestplot &lt;- 
function (df, name = name, estimate = estimate, se = se, pvalue = NULL, 
          colour = NULL, shape = NULL, logodds = FALSE, psignif = 0.05, 
          ci = 0.95, ...) 
{
  stopifnot(is.data.frame(df))
  stopifnot(is.logical(logodds))
  name &lt;- enquo(name)
  estimate &lt;- enquo(estimate)
  se &lt;- enquo(se)
  pvalue &lt;- enquo(pvalue)
  colour &lt;- enquo(colour)
  shape &lt;- enquo(shape)
  args &lt;- list(...)
  const &lt;- stats::qnorm(1 - (1 - ci)/2)
  df &lt;- df %&gt;% dplyr::mutate(`:=`(!!name, factor(!!name, levels = !!name %&gt;% 
                                                   unique() %&gt;% rev(), ordered = TRUE)), .xmin = !!estimate - 
                               const * !!se, .xmax = !!estimate + const * !!se, .filled = TRUE, 
                             .label = sprintf(&quot;%.2f&quot;, !!estimate))
  if (logodds) {
    df &lt;- df %&gt;% mutate(.xmin = exp(.data<span class="math-container">$.xmin), .xmax = exp(.data$</span>.xmax), 
                        `:=`(!!estimate, exp(!!estimate)))
  }
  if (!quo_is_null(pvalue)) {
    df &lt;- df %&gt;% dplyr::mutate(.filled = !!pvalue &lt; !!psignif)
  }
  g &lt;- ggplot2::ggplot(df, aes(x = !!estimate, y = !!name))
  if (logodds) {
    if (&quot;xtickbreaks&quot; %in% names(args)) {
      g &lt;- g + scale_x_continuous(trans = &quot;log10&quot;, breaks = args<span class="math-container">$xtickbreaks)
    }
    else {
      g &lt;- g + scale_x_continuous(trans = "log10", breaks = scales::log_breaks(n = 7))
    }
  }
  g &lt;- g + theme_forest() + scale_colour_ng_d() + scale_fill_ng_d() + 
    geom_stripes() + geom_vline(xintercept = ifelse(test = logodds, 
                                                    yes = 1, no = 0), linetype = "solid", size = 0.4, colour = "black")
  g &lt;- g + geom_effect(ggplot2::aes(xmin = .data$</span>.xmin, xmax = .data<span class="math-container">$.xmax, 
                                    colour = !!colour, shape = !!shape, filled = .data$</span>.filled), 
                       position = ggstance::position_dodgev(height = 0.5),
                       fatten=6) + 
    ggplot2::scale_shape_manual(values = c(21L, 22L, 23L, 
                                           24L, 25L)) + guides(colour = guide_legend(reverse = TRUE), 
                                                               shape = guide_legend(reverse = TRUE))
  if (&quot;title&quot; %in% names(args)) {
    g &lt;- g + labs(title = args<span class="math-container">$title)
  }
  if ("subtitle" %in% names(args)) {
    g &lt;- g + labs(subtitle = args$subtitle)
  }
  if ("caption" %in% names(args)) {
    g &lt;- g + labs(caption = args$caption)
  }
  if ("xlab" %in% names(args)) {
    g &lt;- g + labs(x = args$xlab)
  }
  if (!"ylab" %in% names(args)) {
    args$ylab &lt;- ""
  }
  g &lt;- g + labs(y = args$</span>ylab)
  if (&quot;xlim&quot; %in% names(args)) {
    g &lt;- g + coord_cartesian(xlim = args<span class="math-container">$xlim)
  }
  if ("ylim" %in% names(args)) {
    g &lt;- g + ylim(args$ylim)
  }
  if ("xtickbreaks" %in% names(args) &amp; !logodds) {
    g &lt;- g + scale_x_continuous(breaks = args$</span>xtickbreaks)
  }
  g
}
environment(forestplot) &lt;- environment(ggforestplot::forestplot)
</code></pre>

CC BY-SA 4.0
2021-04-27T08:06:48.027Z
Thanks a lot, Greg!!! It was really helpful. I am really indebted to you as I was looking for it for last 3 days and was almost hopeless. You saved me!!! Many thanks!!!
DEEP
CC BY-SA 4.0
2021-04-26T14:53:47.247Z
2021-04-26T14:53:47.247Z
Greg
<p>I am doing metaanalysis with forestplot from ggforestplot package. I have 7 different datasets from 7 different countries. After metaanalysis, I have 7 Effect sizes and a Meta-analysis effect size, i.e., total of 8 effect sizes. Now, I have generated a forest plot using this code:</p>
<pre><code># Forestplot
my_plot &lt;- forestplot(
  df = final,
  estimate = estimate,
  logodds = FALSE,
  colour = country==&quot;metaanalysis&quot;,
  shape = country,
  title = &quot;Associations to disease accross populations&quot;,
  xlab = &quot;Effect Size&quot;,
  #xlim = c(-1.5, 1.5),
  xtickbreaks = c(-1.0, -0.5, -0.45, -0.4, 0, 0.4, 0.45,0.5, 1.0)
)+
  # You may also want to add a manual shape scale to mark meta-analysis with a
  # diamond shape
  ggplot2::scale_shape_manual(
    values = c(5L, 0L, 1L, 2L, 8L, 19L, 4L, 3L),
    
  )
</code></pre>
<p>But, the shapes denoting the countries and the metanalysis seem very small. How can I make them larger for better visualization? Can anyone please help me?</p>
<p><strong>Representative data for replication:</strong></p>
<pre><code>final &lt;- data.frame(
  stringsAsFactors = FALSE,
              name = c(&quot;RIBOSYN2-PWY__flavin_biosynthesis_I_(bacteria_and_plants)&quot;,
                       &quot;PWY-6385__peptidoglycan_biosynthesis_III_(mycobacteria)&quot;,
                       &quot;PWY-6151__S-adenosyl-L-methionine_cycle_I&quot;,
                       &quot;PWY-6387__UDP-N-acetylmuramoyl-pentapeptide_biosynthesis_I_(meso-diaminopimelate_containing)&quot;,
                       &quot;PWY-6700__queuosine_biosynthesis&quot;,
                       &quot;PEPTIDOGLYCANSYN-PWY__peptidoglycan_biosynthesis_I_(meso-diaminopimelate_containing)&quot;,
                       &quot;PWY-6386__UDP-N-acetylmuramoyl-pentapeptide_biosynthesis_II_(lysine-containing)&quot;,
                       &quot;PWY-5667__CDP-diacylglycerol_biosynthesis_I&quot;,
                       &quot;PWY0-1319__CDP-diacylglycerol_biosynthesis_II&quot;,
                       &quot;PWY-6122__5-aminoimidazole_ribonucleotide_biosynthesis_II&quot;,
                       &quot;PWY-6277__superpathway_of_5-aminoimidazole_ribonucleotide_biosynthesis&quot;,
                       &quot;PWY-6163__chorismate_biosynthesis_from_3-dehydroquinate&quot;,
                       &quot;TRPSYN-PWY__L-tryptophan_biosynthesis&quot;,
                       &quot;PANTOSYN-PWY__pantothenate_and_coenzyme_A_biosynthesis_I&quot;,
                       &quot;GLYCOCAT-PWY__glycogen_degradation_I_(bacterial)&quot;,
                       &quot;P161-PWY__acetylene_degradation&quot;,
                       &quot;FUC-RHAMCAT-PWY__superpathway_of_fucose_and_rhamnose_degradation&quot;,
                       &quot;P108-PWY__pyruvate_fermentation_to_propanoate_I&quot;,
                       &quot;PWY-7328__superpathway_of_UDP-glucose-derived_O-antigen_building_blocks_biosynthesis&quot;,
                       &quot;TCA__TCA_cycle_I_(prokaryotic)&quot;,
                       &quot;PWY-6901__superpathway_of_glucose_and_xylose_degradation&quot;,&quot;PWY66-400__glycolysis_VI_(metazoan)&quot;,
                       &quot;FUCCAT-PWY__fucose_degradation&quot;,
                       &quot;PRPP-PWY__superpathway_of_histidine,_purine,_and_pyrimidine_biosynthesis&quot;,
                       &quot;PWY-7234__inosine-5'-phosphate_biosynthesis_III&quot;,
                       &quot;TRPSYN-PWY__L-tryptophan_biosynthesis&quot;,
                       &quot;PWY-6122__5-aminoimidazole_ribonucleotide_biosynthesis_II&quot;,
                       &quot;PWY-6277__superpathway_of_5-aminoimidazole_ribonucleotide_biosynthesis&quot;,
                       &quot;RIBOSYN2-PWY__flavin_biosynthesis_I_(bacteria_and_plants)&quot;,
                       &quot;PWY-6163__chorismate_biosynthesis_from_3-dehydroquinate&quot;,
                       &quot;PWY-5667__CDP-diacylglycerol_biosynthesis_I&quot;,
                       &quot;PWY0-1319__CDP-diacylglycerol_biosynthesis_II&quot;,
                       &quot;PANTOSYN-PWY__pantothenate_and_coenzyme_A_biosynthesis_I&quot;,
                       &quot;RIBOSYN2-PWY__flavin_biosynthesis_I_(bacteria_and_plants)&quot;,
                       &quot;PWY-6386__UDP-N-acetylmuramoyl-pentapeptide_biosynthesis_II_(lysine-containing)&quot;,
                       &quot;RIBOSYN2-PWY__flavin_biosynthesis_I_(bacteria_and_plants)&quot;,
                       &quot;PANTOSYN-PWY__pantothenate_and_coenzyme_A_biosynthesis_I&quot;,
                       &quot;PWY-6385__peptidoglycan_biosynthesis_III_(mycobacteria)&quot;,
                       &quot;PWY-6387__UDP-N-acetylmuramoyl-pentapeptide_biosynthesis_I_(meso-diaminopimelate_containing)&quot;,&quot;PWY-6700__queuosine_biosynthesis&quot;,
                       &quot;PWY-6151__S-adenosyl-L-methionine_cycle_I&quot;,
                       &quot;PWY0-1319__CDP-diacylglycerol_biosynthesis_II&quot;,
                       &quot;PWY-5667__CDP-diacylglycerol_biosynthesis_I&quot;,
                       &quot;PEPTIDOGLYCANSYN-PWY__peptidoglycan_biosynthesis_I_(meso-diaminopimelate_containing)&quot;,
                       &quot;PWY-6387__UDP-N-acetylmuramoyl-pentapeptide_biosynthesis_I_(meso-diaminopimelate_containing)&quot;,
                       &quot;PWY-6385__peptidoglycan_biosynthesis_III_(mycobacteria)&quot;,
                       &quot;PANTOSYN-PWY__pantothenate_and_coenzyme_A_biosynthesis_I&quot;,
                       &quot;PEPTIDOGLYCANSYN-PWY__peptidoglycan_biosynthesis_I_(meso-diaminopimelate_containing)&quot;,&quot;PWY-5667__CDP-diacylglycerol_biosynthesis_I&quot;,
                       &quot;PWY0-1319__CDP-diacylglycerol_biosynthesis_II&quot;),
          estimate = c(0.492903365186722,
                       0.490116714405755,0.470681520902659,0.465726944992238,
                       0.461786439528495,0.455469435286562,0.449174326308655,
                       0.433755737833203,0.433670791448977,0.412009484469875,
                       0.412009484469875,0.409849212159568,0.407818381473059,
                       0.406187518931948,-0.405573831841341,-0.407806403622317,
                       -0.418351108232386,-0.419107645158175,-0.420781760133428,
                       -0.441930843508614,-0.444723954813865,-0.451224756237618,
                       -0.504642907784859,-0.515843696383127,-0.523823484265933,
                       1.01203740887784,0.860911808112254,0.860911808112254,
                       0.782824395343453,0.779871038531055,0.763412247455786,
                       0.763412247455786,0.744965434413444,0.735086809796288,
                       0.733132943355509,0.731855318166865,0.730523378560539,
                       0.728356885227315,0.694487466356475,0.694335496605963,
                       0.68469489116557,0.680753784497535,0.680732580641012,
                       0.668909750729078,0.665107737526883,0.662352062210176,
                       0.643767077562848,0.640204416487105,0.639460661647805,
                       0.637911093993277),
                se = c(0.10858902830706,
                       0.101375498952004,0.101193730594653,0.101213265518358,
                       0.101165178275411,0.101149604926044,0.101114528367103,
                       0.101177617463096,0.101176196339295,0.10102421433221,
                       0.10102421433221,0.100910703206783,0.101046445558438,
                       0.12265509469116,0.10486856029419,0.103267024648877,0.100867566762125,
                       0.11467836793049,0.10790947678297,0.100997454994136,
                       0.101684644439116,0.103275688295495,0.101358559584742,
                       0.101485340026678,0.131050876787633,0.12672527384678,
                       0.0911987727585976,0.0911987727585976,0.0473284627336248,
                       0.120947206065826,0.120594420271743,0.120594420271743,
                       0.120207965256539,0.12000489747134,0.119965054342127,
                       0.0890575546896603,0.0468935746714197,
                       0.0890043416222531,0.119198789457309,0.0466102635462743,
                       0.119011209638725,0.0883056120686039,0.0883053113523379,
                       0.0881390968551948,0.0880862640207957,0.118593197976584,
                       0.0877953030586674,0.118192523540133,0.0462081105569776,
                       0.0461972348759043),
           country = c(&quot;metaanalysis&quot;,&quot;metaanalysis&quot;,
                       &quot;metaanalysis&quot;,&quot;metaanalysis&quot;,&quot;metaanalysis&quot;,
                       &quot;metaanalysis&quot;,&quot;metaanalysis&quot;,&quot;metaanalysis&quot;,&quot;metaanalysis&quot;,
                       &quot;metaanalysis&quot;,&quot;metaanalysis&quot;,&quot;metaanalysis&quot;,
                       &quot;metaanalysis&quot;,&quot;metaanalysis&quot;,&quot;metaanalysis&quot;,&quot;metaanalysis&quot;,
                       &quot;metaanalysis&quot;,&quot;metaanalysis&quot;,&quot;metaanalysis&quot;,
                       &quot;metaanalysis&quot;,&quot;metaanalysis&quot;,&quot;metaanalysis&quot;,&quot;metaanalysis&quot;,
                       &quot;metaanalysis&quot;,&quot;metaanalysis&quot;,&quot;Swedish&quot;,&quot;Kazakh&quot;,&quot;Kazakh&quot;,
                       &quot;Japanese&quot;,&quot;Swedish&quot;,&quot;Swedish&quot;,&quot;Swedish&quot;,&quot;Swedish&quot;,
                       &quot;Swedish&quot;,&quot;Swedish&quot;,&quot;Kazakh&quot;,&quot;Japanese&quot;,&quot;Kazakh&quot;,
                       &quot;Swedish&quot;,&quot;Japanese&quot;,&quot;Swedish&quot;,&quot;Kazakh&quot;,&quot;Kazakh&quot;,
                       &quot;Kazakh&quot;,&quot;Kazakh&quot;,&quot;Swedish&quot;,&quot;Kazakh&quot;,&quot;Swedish&quot;,&quot;Japanese&quot;,
                       &quot;Japanese&quot;)
)
</code></pre>
<p><strong>Output:</strong></p>
<p><a href="https://i.sstatic.net/OmtLi.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/OmtLi.png" alt="enter image description here" /></a></p>
<p>Thanks</p>

<r>
How to increase the size of the shapes that denotes effect sizes of different datasets and metaanalysis?
# How to increase the size of the shapes that denotes effect sizes of different datasets and metaanalysis?

(Asked by: username_0 on 2021-04-26)

I am doing metaanalysis with forestplot from ggforestplot package. I have 7 different datasets from 7 different countries. After metaanalysis, I have 7 Effect sizes and a Meta-analysis effect size, i.e., total of 8 effect sizes. Now, I have generated a forest plot using this code:
# Forestplot
my_plot <- forestplot(
  df = final,
  estimate = estimate,
  logodds = FALSE,
  colour = country=="metaanalysis",
  shape = country,
  title = "Associations to disease accross populations",
  xlab = "Effect Size",
  #xlim = c(-1.5, 1.5),
  xtickbreaks = c(-1.0, -0.5, -0.45, -0.4, 0, 0.4, 0.45,0.5, 1.0)
)+
  # You may also want to add a manual shape scale to mark meta-analysis with a
  # diamond shape
  ggplot2::scale_shape_manual(
    values = c(5L, 0L, 1L, 2L, 8L, 19L, 4L, 3L),
    
  )

But, the shapes denoting the countries and the metanalysis seem very small. How can I make them larger for better visualization? Can anyone please help me?
Representative data for replication:
final <- data.frame(
  stringsAsFactors = FALSE,
              name = c("RIBOSYN2-PWY__flavin_biosynthesis_I_(bacteria_and_plants)",
                       "PWY-6385__peptidoglycan_biosynthesis_III_(mycobacteria)",
                       "PWY-6151__S-adenosyl-L-methionine_cycle_I",
                       "PWY-6387__UDP-N-acetylmuramoyl-pentapeptide_biosynthesis_I_(meso-diaminopimelate_containing)",
                       "PWY-6700__queuosine_biosynthesis",
                       "PEPTIDOGLYCANSYN-PWY__peptidoglycan_biosynthesis_I_(meso-diaminopimelate_containing)",
                       "PWY-6386__UDP-N-acetylmuramoyl-pentapeptide_biosynthesis_II_(lysine-containing)",
                       "PWY-5667__CDP-diacylglycerol_biosynthesis_I",
                       "PWY0-1319__CDP-diacylglycerol_biosynthesis_II",
                       "PWY-6122__5-aminoimidazole_ribonucleotide_biosynthesis_II",
                       "PWY-6277__superpathway_of_5-aminoimidazole_ribonucleotide_biosynthesis",
                       "PWY-6163__chorismate_biosynthesis_from_3-dehydroquinate",
                       "TRPSYN-PWY__L-tryptophan_biosynthesis",
                       "PANTOSYN-PWY__pantothenate_and_coenzyme_A_biosynthesis_I",
                       "GLYCOCAT-PWY__glycogen_degradation_I_(bacterial)",
                       "P161-PWY__acetylene_degradation",
                       "FUC-RHAMCAT-PWY__superpathway_of_fucose_and_rhamnose_degradation",
                       "P108-PWY__pyruvate_fermentation_to_propanoate_I",
                       "PWY-7328__superpathway_of_UDP-glucose-derived_O-antigen_building_blocks_biosynthesis",
                       "TCA__TCA_cycle_I_(prokaryotic)",
                       "PWY-6901__superpathway_of_glucose_and_xylose_degradation","PWY66-400__glycolysis_VI_(metazoan)",
                       "FUCCAT-PWY__fucose_degradation",
                       "PRPP-PWY__superpathway_of_histidine,_purine,_and_pyrimidine_biosynthesis",
                       "PWY-7234__inosine-5'-phosphate_biosynthesis_III",
                       "TRPSYN-PWY__L-tryptophan_biosynthesis",
                       "PWY-6122__5-aminoimidazole_ribonucleotide_biosynthesis_II",
                       "PWY-6277__superpathway_of_5-aminoimidazole_ribonucleotide_biosynthesis",
                       "RIBOSYN2-PWY__flavin_biosynthesis_I_(bacteria_and_plants)",
                       "PWY-6163__chorismate_biosynthesis_from_3-dehydroquinate",
                       "PWY-5667__CDP-diacylglycerol_biosynthesis_I",
                       "PWY0-1319__CDP-diacylglycerol_biosynthesis_II",
                       "PANTOSYN-PWY__pantothenate_and_coenzyme_A_biosynthesis_I",
                       "RIBOSYN2-PWY__flavin_biosynthesis_I_(bacteria_and_plants)",
                       "PWY-6386__UDP-N-acetylmuramoyl-pentapeptide_biosynthesis_II_(lysine-containing)",
                       "RIBOSYN2-PWY__flavin_biosynthesis_I_(bacteria_and_plants)",
                       "PANTOSYN-PWY__pantothenate_and_coenzyme_A_biosynthesis_I",
                       "PWY-6385__peptidoglycan_biosynthesis_III_(mycobacteria)",
                       "PWY-6387__UDP-N-acetylmuramoyl-pentapeptide_biosynthesis_I_(meso-diaminopimelate_containing)","PWY-6700__queuosine_biosynthesis",
                       "PWY-6151__S-adenosyl-L-methionine_cycle_I",
                       "PWY0-1319__CDP-diacylglycerol_biosynthesis_II",
                       "PWY-5667__CDP-diacylglycerol_biosynthesis_I",
                       "PEPTIDOGLYCANSYN-PWY__peptidoglycan_biosynthesis_I_(meso-diaminopimelate_containing)",
                       "PWY-6387__UDP-N-acetylmuramoyl-pentapeptide_biosynthesis_I_(meso-diaminopimelate_containing)",
                       "PWY-6385__peptidoglycan_biosynthesis_III_(mycobacteria)",
                       "PANTOSYN-PWY__pantothenate_and_coenzyme_A_biosynthesis_I",
                       "PEPTIDOGLYCANSYN-PWY__peptidoglycan_biosynthesis_I_(meso-diaminopimelate_containing)","PWY-5667__CDP-diacylglycerol_biosynthesis_I",
                       "PWY0-1319__CDP-diacylglycerol_biosynthesis_II"),
          estimate = c(0.492903365186722,
                       0.490116714405755,0.470681520902659,0.465726944992238,
                       0.461786439528495,0.455469435286562,0.449174326308655,
                       0.433755737833203,0.433670791448977,0.412009484469875,
                       0.412009484469875,0.409849212159568,0.407818381473059,
                       0.406187518931948,-0.405573831841341,-0.407806403622317,
                       -0.418351108232386,-0.419107645158175,-0.420781760133428,
                       -0.441930843508614,-0.444723954813865,-0.451224756237618,
                       -0.504642907784859,-0.515843696383127,-0.523823484265933,
                       1.01203740887784,0.860911808112254,0.860911808112254,
                       0.782824395343453,0.779871038531055,0.763412247455786,
                       0.763412247455786,0.744965434413444,0.735086809796288,
                       0.733132943355509,0.731855318166865,0.730523378560539,
                       0.728356885227315,0.694487466356475,0.694335496605963,
                       0.68469489116557,0.680753784497535,0.680732580641012,
                       0.668909750729078,0.665107737526883,0.662352062210176,
                       0.643767077562848,0.640204416487105,0.639460661647805,
                       0.637911093993277),
                se = c(0.10858902830706,
                       0.101375498952004,0.101193730594653,0.101213265518358,
                       0.101165178275411,0.101149604926044,0.101114528367103,
                       0.101177617463096,0.101176196339295,0.10102421433221,
                       0.10102421433221,0.100910703206783,0.101046445558438,
                       0.12265509469116,0.10486856029419,0.103267024648877,0.100867566762125,
                       0.11467836793049,0.10790947678297,0.100997454994136,
                       0.101684644439116,0.103275688295495,0.101358559584742,
                       0.101485340026678,0.131050876787633,0.12672527384678,
                       0.0911987727585976,0.0911987727585976,0.0473284627336248,
                       0.120947206065826,0.120594420271743,0.120594420271743,
                       0.120207965256539,0.12000489747134,0.119965054342127,
                       0.0890575546896603,0.0468935746714197,
                       0.0890043416222531,0.119198789457309,0.0466102635462743,
                       0.119011209638725,0.0883056120686039,0.0883053113523379,
                       0.0881390968551948,0.0880862640207957,0.118593197976584,
                       0.0877953030586674,0.118192523540133,0.0462081105569776,
                       0.0461972348759043),
           country = c("metaanalysis","metaanalysis",
                       "metaanalysis","metaanalysis","metaanalysis",
                       "metaanalysis","metaanalysis","metaanalysis","metaanalysis",
                       "metaanalysis","metaanalysis","metaanalysis",
                       "metaanalysis","metaanalysis","metaanalysis","metaanalysis",
                       "metaanalysis","metaanalysis","metaanalysis",
                       "metaanalysis","metaanalysis","metaanalysis","metaanalysis",
                       "metaanalysis","metaanalysis","Swedish","Kazakh","Kazakh",
                       "Japanese","Swedish","Swedish","Swedish","Swedish",
                       "Swedish","Swedish","Kazakh","Japanese","Kazakh",
                       "Swedish","Japanese","Swedish","Kazakh","Kazakh",
                       "Kazakh","Kazakh","Swedish","Kazakh","Swedish","Japanese",
                       "Japanese")
)

Output:

Thanks

**Tags:** r

---

## 1 answers

### Answer by username_1 on 2021-04-26. Score: 1 | Accepted answer

A quick look at the code for forestplot shows that geom_effect is what needs to be modified. If you add a value for fatten changes the size of the shapes in the the figure (but not in the legend), or a value for size will change the shape, line and legend sizes (add to not geom_effect not to the aes layer)
This may be easier said than done as forestplot also seems to call an unexposed function (function quo_is_null). A couple of simple hacks are possible; copy and make your own forestplot in the default environment and remove the call to the function (it seems to just check if pvalue is set), or change the environment of the "new" forestplot to ggforestplot
envorionment(forestplot) <- envornment(ggforestplot::forestplot)

There may be other less awkward methods, but this will work. Fatten changed to size 6 which is massive.
forestplot <- 
function (df, name = name, estimate = estimate, se = se, pvalue = NULL, 
          colour = NULL, shape = NULL, logodds = FALSE, psignif = 0.05, 
          ci = 0.95, ...) 
{
  stopifnot(is.data.frame(df))
  stopifnot(is.logical(logodds))
  name <- enquo(name)
  estimate <- enquo(estimate)
  se <- enquo(se)
  pvalue <- enquo(pvalue)
  colour <- enquo(colour)
  shape <- enquo(shape)
  args <- list(...)
  const <- stats::qnorm(1 - (1 - ci)/2)
  df <- df %>% dplyr::mutate(`:=`(!!name, factor(!!name, levels = !!name %>% 
                                                   unique() %>% rev(), ordered = TRUE)), .xmin = !!estimate - 
                               const * !!se, .xmax = !!estimate + const * !!se, .filled = TRUE, 
                             .label = sprintf("%.2f", !!estimate))
  if (logodds) {
    df <- df %>% mutate(.xmin = exp(.data$.xmin), .xmax = exp(.data$.xmax), 
                        `:=`(!!estimate, exp(!!estimate)))
  }
  if (!quo_is_null(pvalue)) {
    df <- df %>% dplyr::mutate(.filled = !!pvalue < !!psignif)
  }
  g <- ggplot2::ggplot(df, aes(x = !!estimate, y = !!name))
  if (logodds) {
    if ("xtickbreaks" %in% names(args)) {
      g <- g + scale_x_continuous(trans = "log10", breaks = args$xtickbreaks)
    }
    else {
      g <- g + scale_x_continuous(trans = "log10", breaks = scales::log_breaks(n = 7))
    }
  }
  g <- g + theme_forest() + scale_colour_ng_d() + scale_fill_ng_d() + 
    geom_stripes() + geom_vline(xintercept = ifelse(test = logodds, 
                                                    yes = 1, no = 0), linetype = "solid", size = 0.4, colour = "black")
  g <- g + geom_effect(ggplot2::aes(xmin = .data$.xmin, xmax = .data$.xmax, 
                                    colour = !!colour, shape = !!shape, filled = .data$.filled), 
                       position = ggstance::position_dodgev(height = 0.5),
                       fatten=6) + 
    ggplot2::scale_shape_manual(values = c(21L, 22L, 23L, 
                                           24L, 25L)) + guides(colour = guide_legend(reverse = TRUE), 
                                                               shape = guide_legend(reverse = TRUE))
  if ("title" %in% names(args)) {
    g <- g + labs(title = args$title)
  }
  if ("subtitle" %in% names(args)) {
    g <- g + labs(subtitle = args$subtitle)
  }
  if ("caption" %in% names(args)) {
    g <- g + labs(caption = args$caption)
  }
  if ("xlab" %in% names(args)) {
    g <- g + labs(x = args$xlab)
  }
  if (!"ylab" %in% names(args)) {
    args$ylab <- ""
  }
  g <- g + labs(y = args$ylab)
  if ("xlim" %in% names(args)) {
    g <- g + coord_cartesian(xlim = args$xlim)
  }
  if ("ylim" %in% names(args)) {
    g <- g + ylim(args$ylim)
  }
  if ("xtickbreaks" %in% names(args) & !logodds) {
    g <- g + scale_x_continuous(breaks = args$xtickbreaks)
  }
  g
}
environment(forestplot) <- environment(ggforestplot::forestplot)

> **Comments:**
> **username_0**: Thanks a lot, Greg!!! It was really helpful. I am really indebted to you as I was looking for it for last 3 days and was almost hopeless. You saved me!!! Many thanks!!!  

---

