Hello, I would like to be able to plot an array on a plot, something like: |arg1 | arg2 | arg3 val1| 0.9 | 1.1 | 2.4 val2| 0.33 | 0.23 | -1.4 val3| hello| stop | test I know Rwave is good to report but don't want to use it. ? Is there a package that allow quick and dirty plot of dataframes like this ? Thanks a lot -- View this message in context: http://r.789695.n4.nabble.com/print-table-on-plot-tp4589804p4589804.html Sent from the R help mailing list archive at Nabble.com.
On Apr 26, 2012, at 9:26 AM, statquant2 wrote:> Hello, > I would like to be able to plot an array on a plot, something like: > |arg1 | arg2 | arg3 > val1| 0.9 | 1.1 | 2.4 > val2| 0.33 | 0.23 | -1.4 > val3| hello| stop | test > I know Rwave is good to report but don't want to use it. > > ? Is there a package that allow quick and dirty plot of dataframes > like this> mat=matrix(scan(what="", sep="|"), 4,4) 1: |arg1 | arg2 | arg3 5: val1| 0.9 | 1.1 | 2.4 9: val2| 0.33 | 0.23 | -1.4 13: val3| hello| stop | test 17: Read 16 items > mat [,1] [,2] [,3] [,4] [1,] " " "val1" "val2" "val3" [2,] "arg1 " " 0.9 " " 0.33 " " hello" [3,] " arg2 " " 1.1 " " 0.23 " " stop " [4,] " arg3" " 2.4" " -1.4" " test" > xtable::xtable(mat) % latex table generated in R 2.14.2 by xtable 1.6-0 package % Thu Apr 26 12:31:11 2012 \begin{table}[ht] \begin{center} \begin{tabular}{rllll} \hline & 1 & 2 & 3 & 4 \\ \hline 1 & & val1 & val2 & val3 \\ 2 & arg1 & 0.9 & 0.33 & hello \\ 3 & arg2 & 1.1 & 0.23 & stop \\ 4 & arg3 & 2.4 & -1.4 & test \\ \hline \end{tabular} \end{center} \end{table} misleading Nabble footer deleted. -- David Winsemius, MD West Hartford, CT
Hello, ok for xtable, but how will I print the latex code generated in a plot ? Cheers -- View this message in context: http://r.789695.n4.nabble.com/print-table-on-plot-tp4589804p4590407.html Sent from the R help mailing list archive at Nabble.com.
Look at the 'addtable2plot' function in the 'plotrix' package or the 'textplot' function in the 'gplots' package. On Thu, Apr 26, 2012 at 7:26 AM, statquant2 <statquant at gmail.com> wrote:> Hello, > I would like to be able to plot an array on a plot, something like: > ? ? ? ?|arg1 ?| arg2 | arg3 > val1| 0.9 ? ?| 1.1 ? ?| 2.4 > val2| 0.33 ?| 0.23 | -1.4 > val3| hello| stop | test > I know Rwave is good to report but don't want to use it. > > ? Is there a package that allow quick and dirty plot of dataframes like this > ? > > Thanks a lot > > -- > View this message in context: http://r.789695.n4.nabble.com/print-table-on-plot-tp4589804p4589804.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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.-- Gregory (Greg) L. Snow Ph.D. 538280 at gmail.com
Hi, try also grid.table() in gridExtra b. On 27 April 2012 01:26, statquant2 <statquant at gmail.com> wrote:> Hello, > I would like to be able to plot an array on a plot, something like: > ? ? ? ?|arg1 ?| arg2 | arg3 > val1| 0.9 ? ?| 1.1 ? ?| 2.4 > val2| 0.33 ?| 0.23 | -1.4 > val3| hello| stop | test > I know Rwave is good to report but don't want to use it. > > ? Is there a package that allow quick and dirty plot of dataframes like this > ? > > Thanks a lot > > -- > View this message in context: http://r.789695.n4.nabble.com/print-table-on-plot-tp4589804p4589804.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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.
Thank you all. addtable2plot seem to be the best solution visually speaking. ++ -- View this message in context: http://r.789695.n4.nabble.com/print-table-on-plot-tp4589804p4591958.html Sent from the R help mailing list archive at Nabble.com.
On 04/26/2012 11:26 PM, statquant2 wrote:> Hello, > I would like to be able to plot an array on a plot, something like: > |arg1 | arg2 | arg3 > val1| 0.9 | 1.1 | 2.4 > val2| 0.33 | 0.23 | -1.4 > val3| hello| stop | test > I know Rwave is good to report but don't want to use it. > > ? Is there a package that allow quick and dirty plot of dataframes like this > ? >Hi statquant2, Well, there is: tablemat<-matrix(c(0.9,1.1,2.4,0.33,0.23,-1.4,"hello","stop","test"), ncol=3) rownames(tablemat)<-c("val1","val2","val3") colnames(tablemat)<-c("arg1","arg2","arg3") plot(5:1) library(plotrix) addtable2plot(3,4,tablemat,vlines=TRUE,display.rownames=TRUE) Jim