Hi, Excuse me for this silly question how do I get a colour gradient like the one attached. Colours are a bit limited Any specific code for the reference line and pseudo confidence lines. I use "lty", but this do both Here is my argument dat <- escalc("MD", m1i=Mean_TAP, sd1i= SD_TAP, n1i= N_TAP, m2i=Mean_caudal, sd2i= SD_caudal, n2i= N_caudal, slab=Study, dataDuration_of_analgesia) res <- rma(yi, vi, data=dat, measure="MD", method="DL") funnel(res, main="Duration of analegsia", back = 12, xlab="Mean difference (hours)", cex = 1.2, lwd = 2, lty = "solid", mgp = c(2, 1, 0), font.main 1, font.lab = 2, font.axis = 2) Thank you
Hello, No attachment came through, see the posting guide (a link is at the bottom of this and every R-Help e-mail) for the file formats allowed in attachments. What do you mean by colour gradient? `metafor::funnel` has 3 arguments to set colors, - back, set in your code to 12; - shade, unused; - hlines, unused. And when you use functions not in base R, start your scripts with calls to library() to load the packages where those functions can be found. Hope this helps, Rui Barradas ?s 01:37 de 15/05/2022, De Simone escreveu:> Hi, > Excuse me for this silly question > how do I get a colour gradient like the one attached. Colours are a bit > limited > Any specific code for the reference line and pseudo confidence lines. I use > "lty", but this do both > > Here is my argument > > dat <- escalc("MD", m1i=Mean_TAP, sd1i= SD_TAP, n1i= N_TAP, > m2i=Mean_caudal, sd2i= SD_caudal, n2i= N_caudal, slab=Study, data> Duration_of_analgesia) > > > > res <- rma(yi, vi, data=dat, measure="MD", method="DL") > > > funnel(res, main="Duration of analegsia", back = 12, xlab="Mean difference > (hours)", cex = 1.2, lwd = 2, lty = "solid", mgp = c(2, 1, 0), font.main > 1, font.lab = 2, font.axis = 2) > > Thank you > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
Hi, There are a number of functions that will transform numeric values into colors. One is color.scale in the plotrix package. This accepts a vector of numeric values and linearly transforms them into one or more ranges of colors. The resulting colors can then be passed to the appropriate arguments in your plotting function. Jim On Sun, May 15, 2022 at 3:48 PM De Simone <de.simone.belinda87 at gmail.com> wrote:> > Hi, > Excuse me for this silly question > how do I get a colour gradient like the one attached. Colours are a bit > limited > Any specific code for the reference line and pseudo confidence lines. I use > "lty", but this do both > > Here is my argument > > dat <- escalc("MD", m1i=Mean_TAP, sd1i= SD_TAP, n1i= N_TAP, > m2i=Mean_caudal, sd2i= SD_caudal, n2i= N_caudal, slab=Study, data> Duration_of_analgesia) > > > > res <- rma(yi, vi, data=dat, measure="MD", method="DL") > > > funnel(res, main="Duration of analegsia", back = 12, xlab="Mean difference > (hours)", cex = 1.2, lwd = 2, lty = "solid", mgp = c(2, 1, 0), font.main > 1, font.lab = 2, font.axis = 2) > > Thank you > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
Dear Belinda You need to specify lty as a vector to get different colours for the reference line and the limits of the pseudoe-confidence region. Does that solve your problem? Michael On 15/05/2022 01:37, De Simone wrote:> Hi, > Excuse me for this silly question > how do I get a colour gradient like the one attached. Colours are a bit > limited > Any specific code for the reference line and pseudo confidence lines. I use > "lty", but this do both > > Here is my argument > > dat <- escalc("MD", m1i=Mean_TAP, sd1i= SD_TAP, n1i= N_TAP, > m2i=Mean_caudal, sd2i= SD_caudal, n2i= N_caudal, slab=Study, data> Duration_of_analgesia) > > > > res <- rma(yi, vi, data=dat, measure="MD", method="DL") > > > funnel(res, main="Duration of analegsia", back = 12, xlab="Mean difference > (hours)", cex = 1.2, lwd = 2, lty = "solid", mgp = c(2, 1, 0), font.main > 1, font.lab = 2, font.axis = 2) > > Thank you > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Michael dewey.myzen.co.uk/home.html