0
votes

Im having an issue with creating a forest plot in R. My question is this; I keep getting an error message (Error in prFpConvertMultidimArray(mean) : Sorry did not manage to automatically identify the upper/lower boundaries.) Which boundaries is this referring too, and is there anyway I can set the boundaries myself? My code is below:

cochrane_meta<-structure(list( mean= c(-0.96, -0.3194, -0.2443, 0.3619, -0.412,  -0.0859, 0.121, 0.096, -0.02, -0.01), lower= c(-0.969, -0.421, -0.387, 0.178, -0.489, -0.29, -0.461, -0.48, -0.104, -0.098), upper= c(-0.949, -0.209, -0.089, 0.521, -0.328, 0.126, 0.63, 0.614, 0.064, 0.078)), .Names= c("mean", "lower", "upper"), row.names= c(NA, -11L), class= "data.frame") 

tabletext<-cbind( c("", "Study Reference", "WOS:000176556700011", "WOS:000184899600023", "ZOOR13400031947", "WOS:000332479400108", "ZOOR11900034495", "WOS:000243735000023", "WOS:000182080900010 (2)", "WOS:000182080900010", "WOS:000334339000135", "WOS:000334339000135 (2)", NA, "Mean Effect Size"), c("Sample Number", "n", "250", "275", "154", "100", "411", "88", "13", "13", "547", "493", NA, NA), c("Effect Size", "r", "-0.96", "-0.3194", "-0.2443", "0.3619", "-0.412", "-0.0859", "0.121", "0.096", "-0.02", "-0.01", NA, "-0.14727")) 

forestplot(tabletext, cochrane_meta, new_page = TRUE, is.summary=c(TRUE, TRUE, rep(FALSE,10),TRUE), clip=c(-1.00,1.00), xlog=TRUE, col=fpColors(box="royalblue",line="darkblue", summary="royalblue"))

When I try to set the CI limits with this code:

forestplot(tabletext, 
       cochrane_meta, new_page = TRUE,
       is.summary=c(TRUE, TRUE, rep(FALSE,10),TRUE),
       clip=c(-1.00,1.00),
       xlog=TRUE,
       upper = 1.0, lower = -1.0,
       col=fpColors(box="royalblue",line="darkblue", summary="royalblue"))

I get the error message:

Error in forestplot.default(tabletext, cochrane_meta, new_page = TRUE,  : 

Mean, lower and upper contain invalid number of columns Mean columns:3 Lower bound columns: Upper bound columns:

This is my first time posting so any help would be brilliant. If any more information is needed let me know. Thank you!

1

1 Answers

1
votes

I got several errors.

First:

Error in prFpConvertMultidimArray(mean) : Sorry did not manage to automatically identify the upper/lower boundaries.

For that I remaned the objects as the package example:

cochrane_meta <- data.frame(
  coef = c(-0.96, -0.3194, -0.2443, 0.3619, -0.412,  -0.0859, 0.121, 0.096, -0.02, -0.01), 
  low = c(-0.969, -0.421, -0.387, 0.178, -0.489, -0.29, -0.461, -0.48, -0.104, -0.098), 
  high = c(-0.949, -0.209, -0.089, 0.521, -0.328, 0.126, 0.63, 0.614, 0.064, 0.078))

Second:

Error in forestplot.default(tabletext, cochrane_meta, new_page = TRUE,  :  

All argument values (mean, lower, upper, zero, grid and clip) should be provided as exponentials when using the log scale. This is an intentional break with the original forestplot function in order to simplify other arguments such as ticks, clips, and more.

For fix it I changed the plot parameters:

forestplot(tabletext, cochrane_meta, new_page = TRUE,
           is.summary=c(TRUE, TRUE, rep(FALSE,10),TRUE),
           clip=c(-1.00,1.00), xlog=F, 
           col=fpColors(box="royalblue",line="darkblue", summary="royalblue"))

Third:

Error in forestplot.default(tabletext, cochrane_meta, new_page = TRUE,  : 
  You have provided 10 rows in your mean arguement while the labels have 14 rows

And then I deleted some rows in your table.text object:

tabletext<-cbind( c("WOS:000176556700011", "WOS:000184899600023", "ZOOR13400031947", "WOS:000332479400108", "ZOOR11900034495", "WOS:000243735000023", "WOS:000182080900010 (2)", "WOS:000182080900010", "WOS:000334339000135", "WOS:000334339000135 (2)"), 
                  c("250", "275", "154", "100", "411", "88", "13", "13", "547", "493"),
                  c("-0.96", "-0.3194", "-0.2443", "0.3619", "-0.412", "-0.0859", "0.121", "0.096", "-0.02", "-0.01")) 

Finally the plot works as:

forestplot(tabletext, cochrane_meta, new_page = TRUE,
           is.summary=c(TRUE, TRUE, rep(FALSE,10),TRUE),
           clip=c(-1.00,1.00), xlog=F, 
           col=fpColors(box="royalblue",line="darkblue", summary="royalblue"))

And this is my result  this

Hope you fin it useful