metafor package: changing decimal in forest plot to midline decimal

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

metafor package: changing decimal in forest plot to midline decimal

Dietlinde Schmidt
Dear R-Community,

I need to change the punctuation of the reported weights, effect sizes
and confidence intervals in a forest plot created with the
forest()-function in the metafor-package.

Midline decimal means that it looks like this (23·6) rather than that
(23.6).

Do I need to change the forest()-function and if yes which part exactly?
Or is there an otherway how I can do it maybe by changing the
rma()-function, of which the forest()-function is then applied to?

Thanks for any hints and tipps!

Cheers, Linde

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: metafor package: changing decimal in forest plot to midline decimal

Wolfgang Viechtbauer-2
I found this:

https://stat.ethz.ch/pipermail/r-help/2012-August/321057.html

So, use this before drawing the forest plot:

options(OutDec="\xB7")

Best,
Wolfgang

--
Wolfgang Viechtbauer, Ph.D., Statistician
Department of Psychiatry and Psychology
School for Mental Health and Neuroscience
Faculty of Health, Medicine, and Life Sciences
Maastricht University, P.O. Box 616 (VIJV1)
6200 MD Maastricht, The Netherlands
+31 (43) 388-4170 | http://www.wvbauer.com
________________________________________
From: [hidden email] [[hidden email]] On Behalf Of Dietlinde Schmidt [[hidden email]]
Sent: Thursday, July 03, 2014 3:07 PM
To: [hidden email]
Subject: [R] metafor package: changing decimal in forest plot to midline        decimal

Dear R-Community,

I need to change the punctuation of the reported weights, effect sizes
and confidence intervals in a forest plot created with the
forest()-function in the metafor-package.

Midline decimal means that it looks like this (23·6) rather than that
(23.6).

Do I need to change the forest()-function and if yes which part exactly?
Or is there an otherway how I can do it maybe by changing the
rma()-function, of which the forest()-function is then applied to?

Thanks for any hints and tipps!

Cheers, Linde

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: metafor package: changing decimal in forest plot to midline decimal

Dietlinde Schmidt
Thanks for that link, Wolfgang. Unfortunately, there comes the Warning
with it:
"(process:3634): Pango-WARNING **: Invalid UTF-8 string passed to
pango_layout_set_text()"
and decimal being "scrambled" in forest plot and not displaying the
midline decimal.

I think it has to do with the fact, that only 1-byte-codes are allowed
for options(OutDec="\xB7").
Or does it have to do with me using Ubuntu?

Apart from that the options-command does not seem to change the decimal
of values on the "true" x-axis under the plot.

Still searching for a solution.

Cheers,
Linde

Am 05.07.2014 19:06, schrieb Viechtbauer Wolfgang (STAT):

> I found this:
>
> https://stat.ethz.ch/pipermail/r-help/2012-August/321057.html
>
> So, use this before drawing the forest plot:
>
> options(OutDec="\xB7")
>
> Best,
> Wolfgang
>
> --
> Wolfgang Viechtbauer, Ph.D., Statistician
> Department of Psychiatry and Psychology
> School for Mental Health and Neuroscience
> Faculty of Health, Medicine, and Life Sciences
> Maastricht University, P.O. Box 616 (VIJV1)
> 6200 MD Maastricht, The Netherlands
> +31 (43) 388-4170 | http://www.wvbauer.com
> ________________________________________
> From: [hidden email] [[hidden email]] On Behalf Of Dietlinde Schmidt [[hidden email]]
> Sent: Thursday, July 03, 2014 3:07 PM
> To: [hidden email]
> Subject: [R] metafor package: changing decimal in forest plot to midline        decimal
>
> Dear R-Community,
>
> I need to change the punctuation of the reported weights, effect sizes
> and confidence intervals in a forest plot created with the
> forest()-function in the metafor-package.
>
> Midline decimal means that it looks like this (23·6) rather than that
> (23.6).
>
> Do I need to change the forest()-function and if yes which part exactly?
> Or is there an otherway how I can do it maybe by changing the
> rma()-function, of which the forest()-function is then applied to?
>
> Thanks for any hints and tipps!
>
> Cheers, Linde
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: metafor package: changing decimal in forest plot to midline decimal

Wolfgang Viechtbauer-2
I tried this:

library(metafor)
data(dat.bcg)
res <- rma(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg, slab=paste(author, year, sep=", "))
options(OutDec="\xB7")
forest(res)

No warning, no scrambling, and all decimals shown in midline (also on the x-axis). But this is on Windows.

My guess it's a font issue. There may be others that can give more useful advice.

Best,
Wolfgang

> -----Original Message-----
> From: Dietlinde Schmidt [mailto:[hidden email]]
> Sent: Monday, July 07, 2014 10:09
> To: Viechtbauer Wolfgang (STAT); [hidden email]
> Subject: Re: [R] metafor package: changing decimal in forest plot to
> midline decimal
>
> Thanks for that link, Wolfgang. Unfortunately, there comes the Warning
> with it:
> "(process:3634): Pango-WARNING **: Invalid UTF-8 string passed to
> pango_layout_set_text()"
> and decimal being "scrambled" in forest plot and not displaying the
> midline decimal.
>
> I think it has to do with the fact, that only 1-byte-codes are allowed
> for options(OutDec="\xB7").
> Or does it have to do with me using Ubuntu?
>
> Apart from that the options-command does not seem to change the decimal
> of values on the "true" x-axis under the plot.
>
> Still searching for a solution.
>
> Cheers,
> Linde
>
> Am 05.07.2014 19:06, schrieb Viechtbauer Wolfgang (STAT):
> > I found this:
> >
> > https://stat.ethz.ch/pipermail/r-help/2012-August/321057.html
> >
> > So, use this before drawing the forest plot:
> >
> > options(OutDec="\xB7")
> >
> > Best,
> > Wolfgang
> >
> > --
> > Wolfgang Viechtbauer, Ph.D., Statistician
> > Department of Psychiatry and Psychology
> > School for Mental Health and Neuroscience
> > Faculty of Health, Medicine, and Life Sciences
> > Maastricht University, P.O. Box 616 (VIJV1)
> > 6200 MD Maastricht, The Netherlands
> > +31 (43) 388-4170 | http://www.wvbauer.com
> > ________________________________________
> > From: [hidden email] [[hidden email]] On
> Behalf Of Dietlinde Schmidt [[hidden email]]
> > Sent: Thursday, July 03, 2014 3:07 PM
> > To: [hidden email]
> > Subject: [R] metafor package: changing decimal in forest plot to
> midline        decimal
> >
> > Dear R-Community,
> >
> > I need to change the punctuation of the reported weights, effect sizes
> > and confidence intervals in a forest plot created with the
> > forest()-function in the metafor-package.
> >
> > Midline decimal means that it looks like this (23*6) rather than that
> > (23.6).
> >
> > Do I need to change the forest()-function and if yes which part
> exactly?
> > Or is there an otherway how I can do it maybe by changing the
> > rma()-function, of which the forest()-function is then applied to?
> >
> > Thanks for any hints and tipps!
> >
> > Cheers, Linde
> >
> > ______________________________________________
> > [hidden email] mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> > and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: metafor package: changing decimal in forest plot to midline decimal

Jeremy Miles-2
I've found that if you want really fine control over an issue like this in
a chart, the easiest thing to do is to export it as PDF, and then directly
edit the chart in Illustrator (not free) or Inkscape (free).




On 7 July 2014 10:21, Viechtbauer Wolfgang (STAT) <
[hidden email]> wrote:

> I tried this:
>
> library(metafor)
> data(dat.bcg)
> res <- rma(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg,
> slab=paste(author, year, sep=", "))
> options(OutDec="\xB7")
> forest(res)
>
> No warning, no scrambling, and all decimals shown in midline (also on the
> x-axis). But this is on Windows.
>
> My guess it's a font issue. There may be others that can give more useful
> advice.
>
> Best,
> Wolfgang
>
> > -----Original Message-----
> > From: Dietlinde Schmidt [mailto:[hidden email]]
> > Sent: Monday, July 07, 2014 10:09
> > To: Viechtbauer Wolfgang (STAT); [hidden email]
> > Subject: Re: [R] metafor package: changing decimal in forest plot to
> > midline decimal
> >
> > Thanks for that link, Wolfgang. Unfortunately, there comes the Warning
> > with it:
> > "(process:3634): Pango-WARNING **: Invalid UTF-8 string passed to
> > pango_layout_set_text()"
> > and decimal being "scrambled" in forest plot and not displaying the
> > midline decimal.
> >
> > I think it has to do with the fact, that only 1-byte-codes are allowed
> > for options(OutDec="\xB7").
> > Or does it have to do with me using Ubuntu?
> >
> > Apart from that the options-command does not seem to change the decimal
> > of values on the "true" x-axis under the plot.
> >
> > Still searching for a solution.
> >
> > Cheers,
> > Linde
> >
> > Am 05.07.2014 19:06, schrieb Viechtbauer Wolfgang (STAT):
> > > I found this:
> > >
> > > https://stat.ethz.ch/pipermail/r-help/2012-August/321057.html
> > >
> > > So, use this before drawing the forest plot:
> > >
> > > options(OutDec="\xB7")
> > >
> > > Best,
> > > Wolfgang
> > >
> > > --
> > > Wolfgang Viechtbauer, Ph.D., Statistician
> > > Department of Psychiatry and Psychology
> > > School for Mental Health and Neuroscience
> > > Faculty of Health, Medicine, and Life Sciences
> > > Maastricht University, P.O. Box 616 (VIJV1)
> > > 6200 MD Maastricht, The Netherlands
> > > +31 (43) 388-4170 | http://www.wvbauer.com
> > > ________________________________________
> > > From: [hidden email] [[hidden email]] On
> > Behalf Of Dietlinde Schmidt [[hidden email]]
> > > Sent: Thursday, July 03, 2014 3:07 PM
> > > To: [hidden email]
> > > Subject: [R] metafor package: changing decimal in forest plot to
> > midline        decimal
> > >
> > > Dear R-Community,
> > >
> > > I need to change the punctuation of the reported weights, effect sizes
> > > and confidence intervals in a forest plot created with the
> > > forest()-function in the metafor-package.
> > >
> > > Midline decimal means that it looks like this (23*6) rather than that
> > > (23.6).
> > >
> > > Do I need to change the forest()-function and if yes which part
> > exactly?
> > > Or is there an otherway how I can do it maybe by changing the
> > > rma()-function, of which the forest()-function is then applied to?
> > >
> > > Thanks for any hints and tipps!
> > >
> > > Cheers, Linde
> > >
> > > ______________________________________________
> > > [hidden email] mailing list
> > > https://stat.ethz.ch/mailman/listinfo/r-help
> > > PLEASE do read the posting guide http://www.R-project.org/posting-
> > guide.html
> > > and provide commented, minimal, self-contained, reproducible code.
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: metafor package: changing decimal in forest plot to midline decimal

Michael Dewey
In reply to this post by Dietlinde Schmidt
At 09:08 07/07/2014, Dietlinde Schmidt wrote:

>Thanks for that link, Wolfgang. Unfortunately,
>there comes the Warning with it:
>"(process:3634): Pango-WARNING **: Invalid UTF-8
>string passed to pango_layout_set_text()"
>and decimal being "scrambled" in forest plot and
>not displaying the midline decimal.
>
>I think it has to do with the fact, that only
>1-byte-codes are allowed for options(OutDec="\xB7").
>Or does it have to do with me using Ubuntu?

I am not an expert on encodings but I think that
in Unicode it is indeed two bytes but for some
reason in the encoding used in Windows it is a
single byte. It may be that some expert in
encodings can tell you how to temporarily reset
your locale in Ubuntu but I am not that expert.


>Apart from that the options-command does not
>seem to change the decimal of values on the "true" x-axis under the plot.
>
>Still searching for a solution.
>
>Cheers,
>Linde
>
>Am 05.07.2014 19:06, schrieb Viechtbauer Wolfgang (STAT):
>>I found this:
>>
>>https://stat.ethz.ch/pipermail/r-help/2012-August/321057.html
>>
>>So, use this before drawing the forest plot:
>>
>>options(OutDec="\xB7")
>>
>>Best,
>>Wolfgang
>>
>>--
>>Wolfgang Viechtbauer, Ph.D., Statistician
>>Department of Psychiatry and Psychology
>>School for Mental Health and Neuroscience
>>Faculty of Health, Medicine, and Life Sciences
>>Maastricht University, P.O. Box 616 (VIJV1)
>>6200 MD Maastricht, The Netherlands
>>+31 (43) 388-4170 | http://www.wvbauer.com
>>________________________________________
>>From: [hidden email]
>>[[hidden email]] On Behalf Of
>>Dietlinde Schmidt [[hidden email]]
>>Sent: Thursday, July 03, 2014 3:07 PM
>>To: [hidden email]
>>Subject: [R] metafor package: changing decimal
>>in forest plot to midline        decimal
>>
>>Dear R-Community,
>>
>>I need to change the punctuation of the reported weights, effect sizes
>>and confidence intervals in a forest plot created with the
>>forest()-function in the metafor-package.
>>
>>Midline decimal means that it looks like this (23·6) rather than that
>>(23.6).
>>
>>Do I need to change the forest()-function and if yes which part exactly?
>>Or is there an otherway how I can do it maybe by changing the
>>rma()-function, of which the forest()-function is then applied to?
>>
>>Thanks for any hints and tipps!
>>
>>Cheers, Linde
>>
>>______________________________________________
>>[hidden email] mailing list
>>https://stat.ethz.ch/mailman/listinfo/r-help
>>PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>>and provide commented, minimal, self-contained, reproducible code.
>
>

Michael Dewey
[hidden email]
http://www.aghmed.fsnet.co.uk/home.html

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: metafor package: changing decimal in forest plot to midline decimal

Prof Brian Ripley
On 07/07/2014 12:02, Michael Dewey wrote:

> At 09:08 07/07/2014, Dietlinde Schmidt wrote:
>> Thanks for that link, Wolfgang. Unfortunately, there comes the Warning
>> with it:
>> "(process:3634): Pango-WARNING **: Invalid UTF-8 string passed to
>> pango_layout_set_text()"
>> and decimal being "scrambled" in forest plot and not displaying the
>> midline decimal.
>>
>> I think it has to do with the fact, that only 1-byte-codes are allowed
>> for options(OutDec="\xB7").
>> Or does it have to do with me using Ubuntu?
>
> I am not an expert on encodings but I think that in Unicode it is indeed
> two bytes but for some reason in the encoding used in Windows it is a
> single byte. It may be that some expert in encodings can tell you how to
> temporarily reset your locale in Ubuntu but I am not that expert.

All non-ASCII chars are two or more bytes in UTF-8: this one is c2 b7 in
hex.

Ubuntu is based on Debian which micro-packages its encoding support.  On
a standard Linux system you can just use (e.g.) LC_CTYPE=de_DE which is
encoded in Latin-1.   That might not be installed on Debian/Ubuntu, in
which case you need to install it.

OutDec is designed for outputting numbers in an internationalized way:
no known locale uses a centred dot.  (If one did, you could most likely
set LC_NUMERIC to such a locale instead.)

>
>
>> Apart from that the options-command does not seem to change the
>> decimal of values on the "true" x-axis under the plot.
>>
>> Still searching for a solution.
>>
>> Cheers,
>> Linde
>>
>> Am 05.07.2014 19:06, schrieb Viechtbauer Wolfgang (STAT):
>>> I found this:
>>>
>>> https://stat.ethz.ch/pipermail/r-help/2012-August/321057.html
>>>
>>> So, use this before drawing the forest plot:
>>>
>>> options(OutDec="\xB7")
>>>
>>> Best,
>>> Wolfgang
>>>
>>> --
>>> Wolfgang Viechtbauer, Ph.D., Statistician
>>> Department of Psychiatry and Psychology
>>> School for Mental Health and Neuroscience
>>> Faculty of Health, Medicine, and Life Sciences
>>> Maastricht University, P.O. Box 616 (VIJV1)
>>> 6200 MD Maastricht, The Netherlands
>>> +31 (43) 388-4170 | http://www.wvbauer.com
>>> ________________________________________
>>> From: [hidden email] [[hidden email]] On
>>> Behalf Of Dietlinde Schmidt [[hidden email]]
>>> Sent: Thursday, July 03, 2014 3:07 PM
>>> To: [hidden email]
>>> Subject: [R] metafor package: changing decimal in forest plot to
>>> midline        decimal
>>>
>>> Dear R-Community,
>>>
>>> I need to change the punctuation of the reported weights, effect sizes
>>> and confidence intervals in a forest plot created with the
>>> forest()-function in the metafor-package.
>>>
>>> Midline decimal means that it looks like this (23·6) rather than that
>>> (23.6).
>>>
>>> Do I need to change the forest()-function and if yes which part exactly?
>>> Or is there an otherway how I can do it maybe by changing the
>>> rma()-function, of which the forest()-function is then applied to?
>>>
>>> Thanks for any hints and tipps!
>>>
>>> Cheers, Linde
>>>
>>> ______________________________________________
>>> [hidden email] mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide
>>> http://www.R-project.org/posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
>>
>>
>
> Michael Dewey
> [hidden email]
> http://www.aghmed.fsnet.co.uk/home.html
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.


--
Brian D. Ripley,                  [hidden email]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.