Re: [R] Forestplot, grid graphics Viewplot grid.arange

2022-10-14 Thread Michael Dewey
There are several other CRAN packages which provide forest plots (see 
CRAN Task View for details) and they do not all use grip graphics which 
I think the forestplot package does. It might be worth swapping to one 
of them.


Michael

On 14/10/2022 04:34, Jim Lemon wrote:

Hi Mary,
I didn't see any answers to your post, but doing something like this
is quite easy in base graphics. If you are still stuck, I may be able
to suggest something.

Jim

On Mon, Oct 10, 2022 at 6:05 PM Putt, Mary  wrote:



I have created several plots using the forestplot package and the link shown here. 
 
Great package !
Next step is to combine two plots into a single graphic. The code provided on 
the link results in 'bleeding' of the graphics/text into each other. I don't 
want to clip it as I need the text elements. I am guessing the problem involves 
the combination of text and graphics in the 'plot'. I fooled around with the 
original post and also did some hunting online but no luck Thanks in advance.
library(foresplot)
data("dfHRQoL")

#create individual forest plots for Sweden and Denmark
fp_sweden <- dfHRQoL |>
   filter(group == "Sweden") |>
   mutate(est = sprintf("%.2f", mean), .after = labeltext) |>
   forestplot(labeltext = c(labeltext, est),
  title = "Sweden",
  clip = c(-.1, Inf),
  xlab = "EQ-5D index",
  new_page = FALSE)

fp_denmark <- dfHRQoL |>
   filter(group == "Denmark") |>
   mutate(est = sprintf("%.2f", mean), .after = labeltext) |>
   forestplot(labeltext = c(labeltext, est),
  title = "Denmark",
  clip = c(-.1, Inf),
  xlab = "EQ-5D index",
  new_page = FALSE)



#now combine into a single plot using the web code; but this one bleeds into 
each other
library(grid)

#
#Put plots together using grid graphics
#Attempt 1 from website

#
grid.newpage()
borderWidth <- unit(4, "pt")
width <- unit(convertX(unit(1, "npc") - borderWidth, unitTo = "npc", valueOnly = TRUE)/2, 
"npc")
pushViewport(viewport(layout = grid.layout(nrow = 1,
ncol = 3,
widths = unit.c(width,
borderWidth,
width))
)
)
pushViewport(viewport(layout.pos.row = 1,
   layout.pos.col = 1))
fp_sweden
upViewport()
pushViewport(viewport(layout.pos.row = 1,
   layout.pos.col = 2))
grid.rect(gp = gpar(fill = "grey", col = "red"))
upViewport()
pushViewport(viewport(layout.pos.row = 1,
   layout.pos.col = 3))
fp_denmark
upViewport(2)



#Attempt 2 from website, still a problem.

grid.newpage()
borderWidth <- unit(4, "pt")
width <- unit(convertX(unit(1, "npc") - borderWidth, unitTo = "npc", valueOnly = TRUE)/2, 
"npc")
pushViewport(viewport(layout = grid.layout(nrow = 1,
ncol = 3,
widths = c(0.45, 0.1, 0.45))
)
)
pushViewport(viewport(layout.pos.row = 1,
   layout.pos.col = 1))
fp_sweden
upViewport()

pushViewport(viewport(layout.pos.row = 1,
   layout.pos.col = 3))
fp_denmark
upViewport(2)

###
#Attempt 3 converting to grobs and use patchwork
###
library(ggplotify)
library(patchwork)

fpd_grob <- grid2grob(print(fp_denmark))

p1 <- grid2grob(print(fp_denmark))
p2 <- grid2grob(print(fp_sweden))
p_both <- wrap_elements(p1) + wrap_elements(p2)
p_both

#same problem with grid.arrange()**strong text**



Mary Putt, PhD, ScD
Professor of Biostatistics
Department of Biostatistics, Epidemiology & Informatics
Pereleman School of Medicine
University of Pennsylvania

215-573-7020

 [[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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
http://www.dewey.myzen.co.uk/home.html

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Forestplot, grid graphics Viewplot grid.arange

2022-10-13 Thread Jim Lemon
Hi Mary,
I didn't see any answers to your post, but doing something like this
is quite easy in base graphics. If you are still stuck, I may be able
to suggest something.

Jim

On Mon, Oct 10, 2022 at 6:05 PM Putt, Mary  wrote:
>
>
> I have created several plots using the forestplot package and the link shown 
> here. 
>  > Great package !
> Next step is to combine two plots into a single graphic. The code provided on 
> the link results in 'bleeding' of the graphics/text into each other. I don't 
> want to clip it as I need the text elements. I am guessing the problem 
> involves the combination of text and graphics in the 'plot'. I fooled around 
> with the original post and also did some hunting online but no luck Thanks in 
> advance.
> library(foresplot)
> data("dfHRQoL")
>
> #create individual forest plots for Sweden and Denmark
> fp_sweden <- dfHRQoL |>
>   filter(group == "Sweden") |>
>   mutate(est = sprintf("%.2f", mean), .after = labeltext) |>
>   forestplot(labeltext = c(labeltext, est),
>  title = "Sweden",
>  clip = c(-.1, Inf),
>  xlab = "EQ-5D index",
>  new_page = FALSE)
>
> fp_denmark <- dfHRQoL |>
>   filter(group == "Denmark") |>
>   mutate(est = sprintf("%.2f", mean), .after = labeltext) |>
>   forestplot(labeltext = c(labeltext, est),
>  title = "Denmark",
>  clip = c(-.1, Inf),
>  xlab = "EQ-5D index",
>  new_page = FALSE)
>
>
>
> #now combine into a single plot using the web code; but this one bleeds into 
> each other
> library(grid)
>
> #
> #Put plots together using grid graphics
> #Attempt 1 from website
>
> #
> grid.newpage()
> borderWidth <- unit(4, "pt")
> width <- unit(convertX(unit(1, "npc") - borderWidth, unitTo = "npc", 
> valueOnly = TRUE)/2, "npc")
> pushViewport(viewport(layout = grid.layout(nrow = 1,
>ncol = 3,
>widths = unit.c(width,
>borderWidth,
>width))
> )
> )
> pushViewport(viewport(layout.pos.row = 1,
>   layout.pos.col = 1))
> fp_sweden
> upViewport()
> pushViewport(viewport(layout.pos.row = 1,
>   layout.pos.col = 2))
> grid.rect(gp = gpar(fill = "grey", col = "red"))
> upViewport()
> pushViewport(viewport(layout.pos.row = 1,
>   layout.pos.col = 3))
> fp_denmark
> upViewport(2)
>
>
> 
> #Attempt 2 from website, still a problem.
> 
> grid.newpage()
> borderWidth <- unit(4, "pt")
> width <- unit(convertX(unit(1, "npc") - borderWidth, unitTo = "npc", 
> valueOnly = TRUE)/2, "npc")
> pushViewport(viewport(layout = grid.layout(nrow = 1,
>ncol = 3,
>widths = c(0.45, 0.1, 0.45))
> )
> )
> pushViewport(viewport(layout.pos.row = 1,
>   layout.pos.col = 1))
> fp_sweden
> upViewport()
>
> pushViewport(viewport(layout.pos.row = 1,
>   layout.pos.col = 3))
> fp_denmark
> upViewport(2)
>
> ###
> #Attempt 3 converting to grobs and use patchwork
> ###
> library(ggplotify)
> library(patchwork)
>
> fpd_grob <- grid2grob(print(fp_denmark))
>
> p1 <- grid2grob(print(fp_denmark))
> p2 <- grid2grob(print(fp_sweden))
> p_both <- wrap_elements(p1) + wrap_elements(p2)
> p_both
>
> #same problem with grid.arrange()**strong text**
>
>
>
> Mary Putt, PhD, ScD
> Professor of Biostatistics
> Department of Biostatistics, Epidemiology & Informatics
> Pereleman School of Medicine
> University of Pennsylvania
>
> 215-573-7020
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


[R] Forestplot, grid graphics Viewplot grid.arange

2022-10-10 Thread Putt, Mary


I have created several plots using the forestplot package and the link shown 
here. 
 
Great package !
Next step is to combine two plots into a single graphic. The code provided on 
the link results in 'bleeding' of the graphics/text into each other. I don't 
want to clip it as I need the text elements. I am guessing the problem involves 
the combination of text and graphics in the 'plot'. I fooled around with the 
original post and also did some hunting online but no luck Thanks in advance.
library(foresplot)
data("dfHRQoL")

#create individual forest plots for Sweden and Denmark
fp_sweden <- dfHRQoL |>
  filter(group == "Sweden") |>
  mutate(est = sprintf("%.2f", mean), .after = labeltext) |>
  forestplot(labeltext = c(labeltext, est),
 title = "Sweden",
 clip = c(-.1, Inf),
 xlab = "EQ-5D index",
 new_page = FALSE)

fp_denmark <- dfHRQoL |>
  filter(group == "Denmark") |>
  mutate(est = sprintf("%.2f", mean), .after = labeltext) |>
  forestplot(labeltext = c(labeltext, est),
 title = "Denmark",
 clip = c(-.1, Inf),
 xlab = "EQ-5D index",
 new_page = FALSE)



#now combine into a single plot using the web code; but this one bleeds into 
each other
library(grid)

#
#Put plots together using grid graphics
#Attempt 1 from website

#
grid.newpage()
borderWidth <- unit(4, "pt")
width <- unit(convertX(unit(1, "npc") - borderWidth, unitTo = "npc", valueOnly 
= TRUE)/2, "npc")
pushViewport(viewport(layout = grid.layout(nrow = 1,
   ncol = 3,
   widths = unit.c(width,
   borderWidth,
   width))
)
)
pushViewport(viewport(layout.pos.row = 1,
  layout.pos.col = 1))
fp_sweden
upViewport()
pushViewport(viewport(layout.pos.row = 1,
  layout.pos.col = 2))
grid.rect(gp = gpar(fill = "grey", col = "red"))
upViewport()
pushViewport(viewport(layout.pos.row = 1,
  layout.pos.col = 3))
fp_denmark
upViewport(2)



#Attempt 2 from website, still a problem.

grid.newpage()
borderWidth <- unit(4, "pt")
width <- unit(convertX(unit(1, "npc") - borderWidth, unitTo = "npc", valueOnly 
= TRUE)/2, "npc")
pushViewport(viewport(layout = grid.layout(nrow = 1,
   ncol = 3,
   widths = c(0.45, 0.1, 0.45))
)
)
pushViewport(viewport(layout.pos.row = 1,
  layout.pos.col = 1))
fp_sweden
upViewport()

pushViewport(viewport(layout.pos.row = 1,
  layout.pos.col = 3))
fp_denmark
upViewport(2)

###
#Attempt 3 converting to grobs and use patchwork
###
library(ggplotify)
library(patchwork)

fpd_grob <- grid2grob(print(fp_denmark))

p1 <- grid2grob(print(fp_denmark))
p2 <- grid2grob(print(fp_sweden))
p_both <- wrap_elements(p1) + wrap_elements(p2)
p_both

#same problem with grid.arrange()**strong text**



Mary Putt, PhD, ScD
Professor of Biostatistics
Department of Biostatistics, Epidemiology & Informatics
Pereleman School of Medicine
University of Pennsylvania

215-573-7020

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


[R] Forestplot question

2012-05-02 Thread Ben Ganzfried
Hi,

I'm trying to build a Forest Plot using the second and fourth columns in
the table (test.csv) below. My code is the following:
curated - data.frame(test.csv)
tmp - curated$coef
tmp1 - curated$se_coef
plt - metaplot(tmp, tmp1, xlim = c(-.45, .45))

I keep getting the following error at the last line and am not sure why:
Error in if (is.na(lower[i] + upper[i])) next :
  argument is of length zero

For the metaplot() function, the help page looks like at a minimum I need
to input the point estimates from the studies as well as the standard
errors of the point estimates as parameters (an earlier error occurred
telling me I needed xlim as well).  I would greatly appreciate any
clarification anyone can provide.

 IDs coef exp_coef se_coef z Pr(|z|)  1 -0.203063307 0.816226567
0.082936899 -2.448407282 0.014348936  2 0 1 0 NA NA  3 -0.193553687
0.824025596 0.114027975 -1.697422824 0.089616751  4 -0.032175939 0.968336199
0.239318707 -0.134448074 0.893048269  5 -0.20511693 0.814552066 0.121275633
-1.691328457 0.090774088  6 -0.201827336 0.817236023 0.154827334 -1.30356398
0.192382289  7 -0.439783875 0.644175628 0.105856496 -4.154528917 3.26E-05  8
-0.262717505 0.768959094 0.144606241 -1.816778471 0.069251041  9
-0.208431217 0.811856875 0.225960968 -0.922421329 0.356308848

[[alternative HTML version deleted]]

__
R-help@r-project.org 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.


Re: [R] Forestplot question

2012-05-02 Thread Thomas Lumley
It works for me with your data:

 dat-read.table(/tmp/foo.txt,header=TRUE)
 metaplot(a$coef,a$se_coef)

It has boxes of size zero for the point estimates, but that's because
you give the standard error as zero for the second estimate, which
implies all the other boxes should be infinitely smaller.   Presumably
the std error isn't actually zero.

 -thomas

On Thu, May 3, 2012 at 5:39 AM, Ben Ganzfried
benganzfr...@post.harvard.edu wrote:
 Hi,

 I'm trying to build a Forest Plot using the second and fourth columns in
 the table (test.csv) below. My code is the following:
 curated - data.frame(test.csv)
 tmp - curated$coef
 tmp1 - curated$se_coef
 plt - metaplot(tmp, tmp1, xlim = c(-.45, .45))

 I keep getting the following error at the last line and am not sure why:
 Error in if (is.na(lower[i] + upper[i])) next :
  argument is of length zero

 For the metaplot() function, the help page looks like at a minimum I need
 to input the point estimates from the studies as well as the standard
 errors of the point estimates as parameters (an earlier error occurred
 telling me I needed xlim as well).  I would greatly appreciate any
 clarification anyone can provide.

  IDs coef exp_coef se_coef z Pr(|z|)  1 -0.203063307 0.816226567
 0.082936899 -2.448407282 0.014348936  2 0 1 0 NA NA  3 -0.193553687
 0.824025596 0.114027975 -1.697422824 0.089616751  4 -0.032175939 0.968336199
 0.239318707 -0.134448074 0.893048269  5 -0.20511693 0.814552066 0.121275633
 -1.691328457 0.090774088  6 -0.201827336 0.817236023 0.154827334 -1.30356398
 0.192382289  7 -0.439783875 0.644175628 0.105856496 -4.154528917 3.26E-05  8
 -0.262717505 0.768959094 0.144606241 -1.816778471 0.069251041  9
 -0.208431217 0.811856875 0.225960968 -0.922421329 0.356308848

        [[alternative HTML version deleted]]

 __
 R-help@r-project.org 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.



-- 
Thomas Lumley
Professor of Biostatistics
University of Auckland

__
R-help@r-project.org 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.


Re: [R] ForestPlot or similar

2010-11-02 Thread Mestat

Thanks Matt,
I am having a problem now to use this function. The function separately
works fine. But the problem is that I am working with a simulation, so i
placed the CREDPLOT function in my program and added the following commands
according my data:

#MY DATA, ESTIMATES, LOWER AND UPPER INTERVALS
rw_cibas_quantile_ori_m-rw_quantile_app_ori[-51:-1000]
rw_cibas_low_quantile_ori_l-rw_cibas_low_quantile_ori[-51:-1000]
rw_cibas_up_quantile_ori_u-rw_cibas_up_quantile_ori[-51:-1000]

#GRAPHIC
jpeg ('Nfp_rw_bas_quantile_ori.jpeg')
forestplot(rw_cibas_quantile_ori_m,rw_cibas_low_quantile_ori_l,rw_cibas_up_quantile_ori_u,cen=403.677)
dev.off()

My program is running fine, but I am not getting any graphic. I did the
graphic using the function FORESTPLOT, but the graphic provided by the
function CREDPLOT is much better. Here is my code:

rw_ciper_gini_ori_m-rw_gini_app_ori[-51:-1000]
rw_ciper_low_gini_ori_l-rw_ciper_low_gini_ori[-51:-1000]
rw_ciper_up_gini_ori_u-rw_ciper_up_gini_ori[-51:-1000]
tabletext-cbind(c(rep( ,50),NA))
rw_ciper_gini_ori_m-c(rw_ciper_gini_ori_m,NA)
rw_ciper_low_gini_ori_l-c(rw_ciper_low_gini_ori_l,NA)
rw_ciper_up_gini_ori_u-c(rw_ciper_up_gini_ori_u,NA)
jpeg ('Sfp_rw_per_gini_ori.jpeg')
forestplot(tabletext,rw_ciper_gini_ori_m,rw_ciper_low_gini_ori_l,rw_ciper_up_gini_ori_u,zero=0.4,col=meta.colors(box=royalblue,line=darkblue))
dev.off()

Any information about whats is missing/wrong in order to obtain the graphic
with the function CREDPLOT is welcomed.
Thanks is advance,
Marcio
-- 
View this message in context: 
http://r.789695.n4.nabble.com/ForestPlot-or-similar-tp3020374p3024354.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org 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.


Re: [R] ForestPlot or similar

2010-11-02 Thread Abhijit Dasgupta
You need to use a print statement

print(forestplot())

Lattice and ggplot2 need to be explicitly printed to get output into 
jpeg. I believe Matt's function only provides the graphics object and 
not the printed version.

Abhijit
On 11/2/2010 4:32 PM, Mestat wrote:
 Thanks Matt,
 I am having a problem now to use this function. The function separately
 works fine. But the problem is that I am working with a simulation, so i
 placed the CREDPLOT function in my program and added the following commands
 according my data:

 #MY DATA, ESTIMATES, LOWER AND UPPER INTERVALS
 rw_cibas_quantile_ori_m-rw_quantile_app_ori[-51:-1000]
 rw_cibas_low_quantile_ori_l-rw_cibas_low_quantile_ori[-51:-1000]
 rw_cibas_up_quantile_ori_u-rw_cibas_up_quantile_ori[-51:-1000]

 #GRAPHIC
 jpeg ('Nfp_rw_bas_quantile_ori.jpeg')
 forestplot(rw_cibas_quantile_ori_m,rw_cibas_low_quantile_ori_l,rw_cibas_up_quantile_ori_u,cen=403.677)
 dev.off()

 My program is running fine, but I am not getting any graphic. I did the
 graphic using the function FORESTPLOT, but the graphic provided by the
 function CREDPLOT is much better. Here is my code:

 rw_ciper_gini_ori_m-rw_gini_app_ori[-51:-1000]
 rw_ciper_low_gini_ori_l-rw_ciper_low_gini_ori[-51:-1000]
 rw_ciper_up_gini_ori_u-rw_ciper_up_gini_ori[-51:-1000]
 tabletext-cbind(c(rep( ,50),NA))
 rw_ciper_gini_ori_m-c(rw_ciper_gini_ori_m,NA)
 rw_ciper_low_gini_ori_l-c(rw_ciper_low_gini_ori_l,NA)
 rw_ciper_up_gini_ori_u-c(rw_ciper_up_gini_ori_u,NA)
 jpeg ('Sfp_rw_per_gini_ori.jpeg')
 forestplot(tabletext,rw_ciper_gini_ori_m,rw_ciper_low_gini_ori_l,rw_ciper_up_gini_ori_u,zero=0.4,col=meta.colors(box=royalblue,line=darkblue))
 dev.off()

 Any information about whats is missing/wrong in order to obtain the graphic
 with the function CREDPLOT is welcomed.
 Thanks is advance,
 Marcio


[[alternative HTML version deleted]]

__
R-help@r-project.org 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.


[R] ForestPlot or similar

2010-10-30 Thread Mestat

Hi listers,
I am trying to plot some confidence intervals. The function FORESTPLOT,
would work, but I need something more simple. I dont need to define the text
labels. Is there another function that I can plot some confidence intervals.
Thanks in advance,
Marcio
-- 
View this message in context: 
http://r.789695.n4.nabble.com/ForestPlot-or-similar-tp3020374p3020374.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org 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.


Re: [R] ForestPlot or similar

2010-10-30 Thread Mestat

Here is one example:
I have three vectors (mean,lower interval, upper interval)
mean-c(2,4,6,8)
l-c(1,2,3,4)
u-c(4,8,12,16)
How would I plot that if I want to use the FORESTPLOT function. I dont need
to use the TABLETEXT option.
I am working in something like this:
tabletext-c(NA,NA,NA,NA,NA)
mean-c(NA,2,4,6,8)
l-c(NA,1,2,3,4)
u-c(NA,4,8,12,16)
forestplot(tabletext,mean,l,u,zero=0)
But I am having a problem with the length of the dimension...
Thanks in advance,
Marcio

-- 
View this message in context: 
http://r.789695.n4.nabble.com/ForestPlot-or-similar-tp3020374p3020394.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org 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.


Re: [R] ForestPlot or similar

2010-10-30 Thread Matt Shotwell
Here is a small function for forest plots in R, with an example:

http://biostatmatt.com/wiki/r-credplot

-Matt

On Sat, 2010-10-30 at 11:40 -0400, Mestat wrote:
 Here is one example:
 I have three vectors (mean,lower interval, upper interval)
 mean-c(2,4,6,8)
 l-c(1,2,3,4)
 u-c(4,8,12,16)
 How would I plot that if I want to use the FORESTPLOT function. I dont need
 to use the TABLETEXT option.
 I am working in something like this:
 tabletext-c(NA,NA,NA,NA,NA)
 mean-c(NA,2,4,6,8)
 l-c(NA,1,2,3,4)
 u-c(NA,4,8,12,16)
 forestplot(tabletext,mean,l,u,zero=0)
 But I am having a problem with the length of the dimension...
 Thanks in advance,
 Marcio
 

-- 
Matthew S. Shotwell
Graduate Student 
Division of Biostatistics and Epidemiology
Medical University of South Carolina

__
R-help@r-project.org 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.


[R] forestplot function in rmeta package

2009-06-08 Thread carol white
Hi,
It is known that the area of square plotted by forestplot is proportional to 
the studies' weights. But since there is not weight parameter in forestplot 
function, how does this function proportion the area of each square based on 
the related study's weight?

Look forward to your reply,

Carol



  
[[alternative HTML version deleted]]

__
R-help@r-project.org 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.


Re: [R] forestplot function in rmeta package

2009-06-08 Thread Michael Dewey

At 08:38 08/06/2009, carol white wrote:

Hi,
It is known that the area of square plotted by forestplot is 
proportional to the studies' weights. But since there is not weight 
parameter in forestplot function, how does this function proportion 
the area of each square based on the related study's weight?


Carol, you can examine the source code of forestplot to find out how 
it performs all its calculations.

It calls drawNormalCI to draw the study lines
drawNormalCI has a parameter size
somewhere near the middle of the code you can see how it calculates 
info which it supplies as size to drawNormalCI


If you do not like how it does it you can make your own copy of 
forestplot and change it.



Look forward to your reply,

Carol




[[alternative HTML version deleted]]


Michael Dewey
http://www.aghmed.fsnet.co.uk

__
R-help@r-project.org 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.


Re: [R] Forestplot () box size question

2009-03-22 Thread Thomas Lumley

On Sat, 21 Mar 2009, Gerard Smits wrote:


I have tried several sites (2 in Ca and also Australia) and find only
version 2.14.

Which site did you pull 2.15 from?


I have checked half a dozen sites in various countries, and they all have 2.15 
(even in the Southern Hemisphere -- it's not that updates flow the wrong way 
south of the equator). The CRAN mirror status page says that no mirrors are 
more than a couple of days out of date.

Mostly likely you have an old version of R. CRAN binaries are built only for 
the current version of R.

 -thomas

Thomas Lumley   Assoc. Professor, Biostatistics
tlum...@u.washington.eduUniversity of Washington, Seattle

__
R-help@r-project.org 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.


Re: [R] Forestplot () box size question

2009-03-22 Thread Gerard Smits
Yes, my R is a few versions old.  I did not realize that the package 
version was dependent on the R version.  Thanks.  Gerard

PS was able to apply the code suggested by David W. to the 2.14 
version and got it to work.

At 12:32 AM 3/22/2009, Thomas Lumley wrote:
On Sat, 21 Mar 2009, Gerard Smits wrote:

I have tried several sites (2 in Ca and also Australia) and find only
version 2.14.

Which site did you pull 2.15 from?

I have checked half a dozen sites in various countries, and they all 
have 2.15 (even in the Southern Hemisphere -- it's not that updates 
flow the wrong way south of the equator). The CRAN mirror status 
page says that no mirrors are more than a couple of days out of date.

Mostly likely you have an old version of R. CRAN binaries are built 
only for the current version of R.

  -thomas

Thomas Lumley   Assoc. Professor, Biostatistics
tlum...@u.washington.eduUniversity of Washington, Seattle



[[alternative HTML version deleted]]

__
R-help@r-project.org 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.


[R] Forestplot () box size question

2009-03-21 Thread Gerard Smits
Hi All,

I have been able to modify the x-axis to start at zero by adding xlow 
and xhigh parameters; that was pretty simple.  I have been unable to 
find the location of the code that would turn off the information 
weighting of the box size (I have smaller randomized trials getting 
less weight than a much larger non-randomized trial).  The function 
is forestplot() from rmeta.

Thanks for any help.

Gerard

Slightly modified working function with data and a call follows:


fplot=function (labeltext, mean, lower, upper, align = NULL, 
is.summary = FALSE,
 clip = c(-Inf, Inf), xlab = , zero = 1, graphwidth = unit(3,inches),
 col = meta.colors(), xlog = FALSE, xticks = NULL,
 xlow=0, xhigh, digitsize,
 ...)
{
 require(grid)  || stop(`grid' package not found)
 require(rmeta) || stop(`rmeta' package not found)

 drawNormalCI - function(LL, OR, UL, size)
 {

 size = 0.75 * size
 clipupper - convertX(unit(UL, native), npc, valueOnly = TRUE)  1
 cliplower - convertX(unit(LL, native), npc, valueOnly = TRUE)  0
 box - convertX(unit(OR, native), npc, valueOnly = TRUE)
 clipbox - box  0 || box  1

 if (clipupper || cliplower)
 {
 ends - both
 lims - unit(c(0, 1), c(npc, npc))
 if (!clipupper) {
 ends - first
 lims - unit(c(0, UL), c(npc, native))
 }
 if (!cliplower) {
 ends - last
 lims - unit(c(LL, 1), c(native, npc))
 }
 grid.lines(x = lims, y = 0.5, arrow = arrow(ends = ends,
 length = unit(0.05, inches)), gp = gpar(col = col$lines))

 if (!clipbox)
 grid.rect(x = unit(OR, native), width = unit(size,
   snpc), height = unit(size, snpc), gp = 
gpar(fill = col$box,
   col = col$box))
 }
 else {
 grid.lines(x = unit(c(LL, UL), native), y = 0.5,
 gp = gpar(col = col$lines))
 grid.rect(x = unit(OR, native), width = unit(size,
 snpc), height = unit(size, snpc), gp = gpar(fill 
= col$box,
 col = col$box))
 if ((convertX(unit(OR, native) + unit(0.5 * size,
 lines), native, valueOnly = TRUE)  UL) 
 (convertX(unit(OR, native) - unit(0.5 * size,
   lines), native, valueOnly = TRUE)  LL))
 grid.lines(x = unit(c(LL, UL), native), y = 0.5,
   gp = gpar(col = col$lines))
 }

 }

 drawSummaryCI - function(LL, OR, UL, size) {
 grid.polygon(x = unit(c(LL, OR, UL, OR), native), y = unit(0.5 +
 c(0, 0.5 * size, 0, -0.5 * size), npc), gp = gpar(fill 
= col$summary,
 col = col$summary))
 }

 plot.new()
 widthcolumn - !apply(is.na(labeltext), 1, any)
 nc - NCOL(labeltext)
 labels - vector(list, nc)
 if (is.null(align))
 align - c(l, rep(r, nc - 1))
 else align - rep(align, length = nc)
 nr - NROW(labeltext)
 is.summary - rep(is.summary, length = nr)
 for (j in 1:nc) {
 labels[[j]] - vector(list, nr)
 for (i in 1:nr) {
 if (is.na(labeltext[i, j]))
 next
 x - switch(align[j], l = 0, r = 1, c = 0.5)
 just - switch(align[j], l = left, r = right, c = center)
 labels[[j]][[i]] - textGrob(labeltext[i, j], x = x,
 just = just, gp = gpar(fontface = if (is.summary[i]) bold
 else plain, col = rep(col$text, length = nr)[i]))
 }
 }
 colgap - unit(3, mm)
 colwidths - unit.c(max(unit(rep(1, sum(widthcolumn)), grobwidth,
 labels[[1]][widthcolumn])), colgap)
 if (nc  1) {
 for (i in 2:nc) colwidths - unit.c(colwidths, max(unit(rep(1,
 sum(widthcolumn)), grobwidth, labels[[i]][widthcolumn])),
 colgap)
 }
 colwidths - unit.c(colwidths, graphwidth)
 pushViewport(viewport(layout = grid.layout(nr + 1, nc * 2 +
 1, widths = colwidths, heights = unit(c(rep(1, nr), 0.5),
 lines
 cwidth - (upper - lower)

 #xrange - c(max(min(lower, na.rm = TRUE), clip[1]), 
min(max(upper, na.rm = TRUE), clip[2]))
 xrange - c(xlow,xhigh)

 info - 1/cwidth
 info - info/max(info[!is.summary], na.rm = TRUE)
 info[is.summary] - 1

 for (j in 1:nc) {
 for (i in 1:nr) {
 if (!is.null(labels[[j]][[i]])) {
 pushViewport(viewport(layout.pos.row = i, 
layout.pos.col = 2 *
   j - 1))
 grid.draw(labels[[j]][[i]])
 popViewport()
 }
 }
 }

 pushViewport(viewport(layout.pos.col = 2 * nc + 1, xscale = xrange))
 grid.lines(x = unit(zero, native), y = 0:1, gp = gpar(col = col$zero))
 if (xlog) {
 if (is.null(xticks)) {
 ticks - pretty(exp(xrange))
 

Re: [R] Forestplot () box size question

2009-03-21 Thread David Winsemius
If you look at the original code (or at the help page), you should see  
a boxsize parameter. If you set that to 1 in the call you get boxes  
all the same size.  Presumably that could be modified to suit your  
needs.


You seem to have removed that section of the code. The two lines with  
that parameter are:

 if (!is.null(boxsize))
info - rep(boxsize, length = length(info))

--
David Winsemius, MD
Heritage Laboratories
West Hartford, CT


On Mar 21, 2009, at 1:03 PM, Gerard Smits wrote:


Hi All,

I have been able to modify the x-axis to start at zero by adding xlow
and xhigh parameters; that was pretty simple.  I have been unable to
find the location of the code that would turn off the information
weighting of the box size (I have smaller randomized trials getting
less weight than a much larger non-randomized trial).  The function
is forestplot() from rmeta.

Thanks for any help.

Gerard

Slightly modified working function with data and a call follows:


fplot=function (labeltext, mean, lower, upper, align = NULL,
is.summary = FALSE,
clip = c(-Inf, Inf), xlab = , zero = 1, graphwidth =  
unit(3,inches),

col = meta.colors(), xlog = FALSE, xticks = NULL,
xlow=0, xhigh, digitsize,
...)
{
require(grid)  || stop(`grid' package not found)
require(rmeta) || stop(`rmeta' package not found)

drawNormalCI - function(LL, OR, UL, size)
{

size = 0.75 * size
clipupper - convertX(unit(UL, native), npc, valueOnly =  
TRUE)  1
cliplower - convertX(unit(LL, native), npc, valueOnly =  
TRUE)  0

box - convertX(unit(OR, native), npc, valueOnly = TRUE)
clipbox - box  0 || box  1

if (clipupper || cliplower)
{
ends - both
lims - unit(c(0, 1), c(npc, npc))
if (!clipupper) {
ends - first
lims - unit(c(0, UL), c(npc, native))
}
if (!cliplower) {
ends - last
lims - unit(c(LL, 1), c(native, npc))
}
grid.lines(x = lims, y = 0.5, arrow = arrow(ends = ends,
length = unit(0.05, inches)), gp = gpar(col = col 
$lines))


if (!clipbox)
grid.rect(x = unit(OR, native), width = unit(size,
  snpc), height = unit(size, snpc), gp =
gpar(fill = col$box,
  col = col$box))
}
else {
grid.lines(x = unit(c(LL, UL), native), y = 0.5,
gp = gpar(col = col$lines))
grid.rect(x = unit(OR, native), width = unit(size,
snpc), height = unit(size, snpc), gp = gpar(fill
= col$box,
col = col$box))
if ((convertX(unit(OR, native) + unit(0.5 * size,
lines), native, valueOnly = TRUE)  UL) 
(convertX(unit(OR, native) - unit(0.5 * size,
  lines), native, valueOnly = TRUE)  LL))
grid.lines(x = unit(c(LL, UL), native), y = 0.5,
  gp = gpar(col = col$lines))
}

}

drawSummaryCI - function(LL, OR, UL, size) {
grid.polygon(x = unit(c(LL, OR, UL, OR), native), y =  
unit(0.5 +

c(0, 0.5 * size, 0, -0.5 * size), npc), gp = gpar(fill
= col$summary,
col = col$summary))
}

plot.new()
widthcolumn - !apply(is.na(labeltext), 1, any)
nc - NCOL(labeltext)
labels - vector(list, nc)
if (is.null(align))
align - c(l, rep(r, nc - 1))
else align - rep(align, length = nc)
nr - NROW(labeltext)
is.summary - rep(is.summary, length = nr)
for (j in 1:nc) {
labels[[j]] - vector(list, nr)
for (i in 1:nr) {
if (is.na(labeltext[i, j]))
next
x - switch(align[j], l = 0, r = 1, c = 0.5)
just - switch(align[j], l = left, r = right, c =  
center)

labels[[j]][[i]] - textGrob(labeltext[i, j], x = x,
just = just, gp = gpar(fontface = if (is.summary[i])  
bold

else plain, col = rep(col$text, length = nr)[i]))
}
}
colgap - unit(3, mm)
colwidths - unit.c(max(unit(rep(1, sum(widthcolumn)),  
grobwidth,

labels[[1]][widthcolumn])), colgap)
if (nc  1) {
for (i in 2:nc) colwidths - unit.c(colwidths, max(unit(rep(1,
sum(widthcolumn)), grobwidth, labels[[i]] 
[widthcolumn])),

colgap)
}
colwidths - unit.c(colwidths, graphwidth)
pushViewport(viewport(layout = grid.layout(nr + 1, nc * 2 +
1, widths = colwidths, heights = unit(c(rep(1, nr), 0.5),
lines
cwidth - (upper - lower)

#xrange - c(max(min(lower, na.rm = TRUE), clip[1]),
min(max(upper, na.rm = TRUE), clip[2]))
xrange - c(xlow,xhigh)

info - 1/cwidth
info - info/max(info[!is.summary], na.rm = TRUE)
info[is.summary] - 1

for (j in 1:nc) {
for (i in 1:nr) {
if (!is.null(labels[[j]][[i]])) {

Re: [R] Forestplot () box size question

2009-03-21 Thread Gerard Smits
Hi David,

I just checked to make sure I had the latest version.  I see no 
boxsize option in the  forestplot function parameters or any other 
place in the code.

function (labeltext, mean, lower, upper, align = NULL, is.summary = FALSE,
 clip = c(-Inf, Inf), xlab = , zero = 0, graphwidth = unit(2,
 inches), col = meta.colors(), xlog = FALSE, xticks = NULL,
 ...)
{


Thanks,

Gerard


At 10:32 AM 3/21/2009, David Winsemius wrote:
  if (!is.null(boxsize))
 info - rep(boxsize, length = length(info))

[[alternative HTML version deleted]]

__
R-help@r-project.org 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.


Re: [R] Forestplot () box size question

2009-03-21 Thread David Winsemius
Latest version is a tad non-specific. The help page for (my) package  
rmeta, version 2.15 (download and compiled today)  says:


Usage
forestplot(labeltext, mean, lower, upper, align = NULL, is.summary =  
FALSE, clip = c(-Inf, Inf), xlab = , zero = 0, graphwidth = unit(2,  
inches), col = meta.colors(), xlog = FALSE, xticks=NULL,  
boxsize=NULL,...)

--
 sessionInfo()
R version 2.8.1 Patched (2009-01-19 r47650)
i386-apple-darwin9.6.0
locale:
en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] grid  stats graphics  grDevices utils datasets   
methods   base

other attached packages:
[1] rmeta_2.15 zoo_1.5-5
loaded via a namespace (and not attached):
[1] lattice_0.17-20 tools_2.8.1
--
David Winsemius, MD
Heritage Laboratories
West Hartford, CT
On Mar 21, 2009, at 2:01 PM, Gerard Smits wrote:


Hi David,

I just checked to make sure I had the latest version.  I see no  
boxsize option in the  forestplot function parameters or any other  
place in the code.


function (labeltext, mean, lower, upper, align = NULL, is.summary =  
FALSE,

clip = c(-Inf, Inf), xlab = , zero = 0, graphwidth = unit(2,
inches), col = meta.colors(), xlog = FALSE, xticks = NULL,
...)
{


Thanks,

Gerard


At 10:32 AM 3/21/2009, David Winsemius wrote:

 if (!is.null(boxsize))
info - rep(boxsize, length = length(info))


__
R-help@r-project.org 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.


Re: [R] Forestplot () box size question

2009-03-21 Thread Gerard Smits
Hi David,

I did a general package update, but it must not have been quite as 
complete as I had hoped.

I will make sure I download 2.15 and go from there.

Thanks for you help.

Gerard

At 11:10 AM 3/21/2009, David Winsemius wrote:
Latest version is a tad non-specific. The help page for (my) package
rmeta, version 2.15 (download and compiled today)  says:

Usage
forestplot(labeltext, mean, lower, upper, align = NULL, is.summary =
FALSE, clip = c(-Inf, Inf), xlab = , zero = 0, graphwidth = unit(2,
inches), col = meta.colors(), xlog = FALSE, xticks=NULL,
boxsize=NULL,...)
--
  sessionInfo()
R version 2.8.1 Patched (2009-01-19 r47650)
i386-apple-darwin9.6.0
locale:
en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] grid  stats graphics  grDevices utils datasets
methods   base
other attached packages:
[1] rmeta_2.15 zoo_1.5-5
loaded via a namespace (and not attached):
[1] lattice_0.17-20 tools_2.8.1
--
David Winsemius, MD
Heritage Laboratories
West Hartford, CT
On Mar 21, 2009, at 2:01 PM, Gerard Smits wrote:

Hi David,

I just checked to make sure I had the latest version.  I see no
boxsize option in the  forestplot function parameters or any other
place in the code.

function (labeltext, mean, lower, upper, align = NULL, is.summary =
FALSE,
 clip = c(-Inf, Inf), xlab = , zero = 0, graphwidth = unit(2,
 inches), col = meta.colors(), xlog = FALSE, xticks = NULL,
 ...)
{


Thanks,

Gerard


At 10:32 AM 3/21/2009, David Winsemius wrote:
  if (!is.null(boxsize))
 info - rep(boxsize, length = length(info))



[[alternative HTML version deleted]]

__
R-help@r-project.org 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.


Re: [R] Forestplot () box size question

2009-03-21 Thread Gerard Smits
I have tried several sites (2 in Ca and also Australia) and find only 
version 2.14.

Which site did you pull 2.15 from?

Thanks

At 11:10 AM 3/21/2009, David Winsemius wrote:
Latest version is a tad non-specific. The help page for (my) package
rmeta, version 2.15 (download and compiled today)  says:

Usage
forestplot(labeltext, mean, lower, upper, align = NULL, is.summary =
FALSE, clip = c(-Inf, Inf), xlab = , zero = 0, graphwidth = unit(2,
inches), col = meta.colors(), xlog = FALSE, xticks=NULL,
boxsize=NULL,...)
--
  sessionInfo()
R version 2.8.1 Patched (2009-01-19 r47650)
i386-apple-darwin9.6.0
locale:
en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] grid  stats graphics  grDevices utils datasets
methods   base
other attached packages:
[1] rmeta_2.15 zoo_1.5-5
loaded via a namespace (and not attached):
[1] lattice_0.17-20 tools_2.8.1
--
David Winsemius, MD
Heritage Laboratories
West Hartford, CT
On Mar 21, 2009, at 2:01 PM, Gerard Smits wrote:

Hi David,

I just checked to make sure I had the latest version.  I see no
boxsize option in the  forestplot function parameters or any other
place in the code.

function (labeltext, mean, lower, upper, align = NULL, is.summary =
FALSE,
 clip = c(-Inf, Inf), xlab = , zero = 0, graphwidth = unit(2,
 inches), col = meta.colors(), xlog = FALSE, xticks = NULL,
 ...)
{


Thanks,

Gerard


At 10:32 AM 3/21/2009, David Winsemius wrote:
  if (!is.null(boxsize))
 info - rep(boxsize, length = length(info))



[[alternative HTML version deleted]]

__
R-help@r-project.org 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.


Re: [R] Forestplot () box size question

2009-03-21 Thread David Winsemius
I use the CMU site. I think it is US PA #1   or some such. I  
suppose the fact that I am using a Mac could affect that but I am  
guessing not.

I also found a copy of the 2.14 docs and boxsize was a parameter in  
that version as well.

-- 
David Winsemius


On Mar 21, 2009, at 2:24 PM, Gerard Smits wrote:

 I have tried several sites (2 in Ca and also Australia) and find  
 only version 2.14.

 Which site did you pull 2.15 from?

 Thanks

 At 11:10 AM 3/21/2009, David Winsemius wrote:
 Latest version is a tad non-specific. The help page for (my)  
 package
 rmeta, version 2.15 (download and compiled today)  says:

 Usage
 forestplot(labeltext, mean, lower, upper, align = NULL, is.summary =
 FALSE, clip = c(-Inf, Inf), xlab = , zero = 0, graphwidth = unit(2,
 inches), col = meta.colors(), xlog = FALSE, xticks=NULL,
 boxsize=NULL,...)
 --
  sessionInfo()
 R version 2.8.1 Patched (2009-01-19 r47650)
 i386-apple-darwin9.6.0
 locale:
 en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8
 attached base packages:
 [1] grid  stats graphics  grDevices utils datasets
 methods   base
 other attached packages:
 [1] rmeta_2.15 zoo_1.5-5
 loaded via a namespace (and not attached):
 [1] lattice_0.17-20 tools_2.8.1
 -- 
 David Winsemius, MD
 Heritage Laboratories
 West Hartford, CT
 On Mar 21, 2009, at 2:01 PM, Gerard Smits wrote:

 Hi David,

 I just checked to make sure I had the latest version.  I see no
 boxsize option in the  forestplot function parameters or any other
 place in the code.

 function (labeltext, mean, lower, upper, align = NULL, is.summary =
 FALSE,
 clip = c(-Inf, Inf), xlab = , zero = 0, graphwidth = unit(2,
 inches), col = meta.colors(), xlog = FALSE, xticks = NULL,
 ...)
 {


 Thanks,

 Gerard


 At 10:32 AM 3/21/2009, David Winsemius wrote:
  if (!is.null(boxsize))
 info - rep(boxsize, length = length(info))



David Winsemius, MD
Heritage Laboratories
West Hartford, CT


[[alternative HTML version deleted]]

__
R-help@r-project.org 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.


Re: [R] forestplot

2009-02-11 Thread Thomas Lumley

On Tue, 10 Feb 2009, Marino, Mark wrote:


Dear R users,

Is there any way to control the size of the box around the mean when
creating a Forest plot using the forestplot function?



No. If you want to customize further, you are probably better off starting with 
less general code. The basic structure is example 1.8 from Paul Murrell's book, 
code at
http://www.stat.auckland.ac.nz/~paul/RGraphics/chapter1.html

 -thomas

Thomas Lumley   Assoc. Professor, Biostatistics
tlum...@u.washington.eduUniversity of Washington, Seattle

__
R-help@r-project.org 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.


Re: [R] forestplot

2009-02-11 Thread Marino, Mark
Thanks, I was able to get what I wanted done by modifying the code, but
I will consider writing my own based upon your suggestion.  Mark 


Mark T. Marino, MD
VP, Early Clinical Development
Mannkind Corp.
61 S. Paramus Road
Paramus, NJ 07652
201-983-5238 Office
203-512-4008 Cell
mmar...@mannkindcorp.com


-Original Message-
From: Thomas Lumley [mailto:tlum...@u.washington.edu] 
Sent: Wednesday, February 11, 2009 5:40 AM
To: Marino, Mark
Cc: r-help@r-project.org
Subject: Re: [R] forestplot

On Tue, 10 Feb 2009, Marino, Mark wrote:

 Dear R users,

 Is there any way to control the size of the box around the mean when 
 creating a Forest plot using the forestplot function?


No. If you want to customize further, you are probably better off
starting with less general code. The basic structure is example 1.8 from
Paul Murrell's book, code at
http://www.stat.auckland.ac.nz/~paul/RGraphics/chapter1.html

  -thomas

Thomas Lumley   Assoc. Professor, Biostatistics
tlum...@u.washington.eduUniversity of Washington, Seattle

__
R-help@r-project.org 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.


[R] forestplot

2009-02-10 Thread Marino, Mark
Dear R users,
 
Is there any way to control the size of the box around the mean when
creating a Forest plot using the forestplot function?
 
regards
 
Mark
 

Mark T. Marino, MD

VP, Early Clinical Development

Mannkind Corp.

61 S. Paramus Road

Paramus, NJ 07652

201-983-5238 Office

203-512-4008 Cell

mmar...@mannkindcorp.com

 

 

[[alternative HTML version deleted]]

__
R-help@r-project.org 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.


Re: [R] forestplot

2009-02-10 Thread Uwe Ligges



Marino, Mark wrote:

Dear R users,
 
Is there any way to control the size of the box around the mean when

creating a Forest plot using the forestplot function?


H,

 forestplot
Error: object 'forestplot' not found

 PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html

 and provide commented, minimal, self-contained, reproducible code.

Uwe Ligges



regards
 
Mark
 


Mark T. Marino, MD

VP, Early Clinical Development

Mannkind Corp.

61 S. Paramus Road

Paramus, NJ 07652

201-983-5238 Office

203-512-4008 Cell

mmar...@mannkindcorp.com

 

 


[[alternative HTML version deleted]]

__
R-help@r-project.org 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.


__
R-help@r-project.org 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.


[R] forestplot and x axis scale

2008-12-08 Thread Pam Murnane
Hello R users,

I would like to create several forestplots with the same X axis, so,
if you were to look at the plots lined up all the X axes would be
identical (and the different plots could be compared).  Here is one
version of code I've used:

mytk10-c(0.1, 0.5, 1, 2, 5, 10)
pdf(file = myfile.pdf,
 pointsize = 7, paper=letter, width=6, height=9)
forestplot(newcite,or,lcl,ucl,zero=0, graphwidth = unit(1.2,inches),
   clip=c(log(0.1),log(10)), xlog=TRUE, xticks=mytk10, xlab=Odds Ratio,
   col=meta.colors(box=darkblue,line=darkblue,zero=grey50))
title(main = list(My title, col=darkblue, font=2))
dev.off()

-- I have changed the width of the pdf output and/or the graphwidth
specified in the forestplot function -- and depending on the length of
the text/table descriptions (in the matrix newcite), the X axis will
vary (when the text is long, the axis is shorter).  I tried fixing the
axis at a relatively small size (using graphwidth), but it would still
be smaller when I was using data with long newcite text.  Do I need
to fix the amount of text for display within newcite?

-- A second and less essential question:  I've used mytk10 for the
axis tickmarks/labels - I'd prefer no decimal points for 1,2,5,and 10
- any way to adjust this?

Thanks in advance for any assistance!

Pam

__
R-help@r-project.org 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.


[R] forestplot() with large number of confidence intervals

2008-02-14 Thread array chip
Hi I am using forestplot() in rmeta package on a
dataset of 45 point estimates with corresponding
confidence intervals. The resulting plot was just too
large and plotted out of the graphic window that I can
not see whole picture. Is there anyway to fix this
problem?

Thanks


  

Looking for last minute shopping deals?

__
R-help@r-project.org 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.