Hi R-experts, Is it possible to add a table (text and lines) to the plot area? I have a data frame that looks something like this:>mydataTime SD Mean 1 2.5 30 2 a.3 40 I am using R 2.6.1, in Windows. Thank you, Judith Flores ____________________________________________________________________________________ Looking for last minute shopping deals?
Judith Flores wrote:> Hi R-experts, > > Is it possible to add a table (text and lines) to > the plot area? > > I have a data frame that looks something like this: > >> mydata > > Time SD Mean > 1 2.5 30 > 2 a.3 40 > > > I am using R 2.6.1, in Windows. > > Thank you, > > Judith FloresIf you use LaTeX there is an elegant way to do that and to have full control over font, justification, etc. Frank> > > > ____________________________________________________________________________________ > Looking for last minute shopping deals? > > ______________________________________________ > R-help at 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. >-- Frank E Harrell Jr Professor and Chair School of Medicine Department of Biostatistics Vanderbilt University
Here is the brute force method. It would probably not be very difficult to turn in into a function. In fact I am pretty sure that someone has but I cannot find what package it is in. x <- "Time SD Mean 1 2.5 30 2 a.3 40" xx <- read.table(textConnection(x), header=TRUE, as.is=TRUE); xx plot(1:10, type="n" ) text(c(1.2, 2, 3), 8, labels=names(xx), cex=.7) arrows(.75,7.75, 3.5, 7.75, length=0) text(c(1.2, 2, 3), 7.5, labels=xx[1,], cex=.7) text(c(1.2, 2, 3), 7.0, labels=xx[2,], cex=.7) arrows(.75, 6.75,3.5, 6.75, length=0) --- Judith Flores <juryef at yahoo.com> wrote:> Hi R-experts, > Is it possible to add a table (text and lines) to > the plot area? > I have a data frame that looks something like this: > >mydata > Time SD Mean > 1 2.5 30 > 2 a.3 40 > I am using R 2.6.1, in Windows. > > Thank you, > > Judith Flores