Re: UnTableForming a TableFormed Table?
- To: mathgroup at smc.vnet.net
- Subject: [mg79057] Re: UnTableForming a TableFormed Table?
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Tue, 17 Jul 2007 03:23:00 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <f7f2ho$o4n$1@smc.vnet.net>
AES wrote: > Suppose you create a "source" table in Table form: > > myTableS = Table[ ----- ], I am not sure to have understood what you mean by "a 'source' table in Table form," since after evaluation myTableS is a list with head *List*. So the "Table form", whatever that means, stay in this form only as long as the expression has not been evaluated (or some *Hold...* attribute is used). > then create a "formatted" version of it, with TableForm options added: What you format is a /list/. You can format it as a table, a matrix, or a grid for instance. > myTableF = TableForm[ TableS, {tableheadings, tablepacings, etc} ] > > Is there any _simple_ way to "UnTableForm" the formatted table to get > back to the unformatted source table? > > myTableS ??=?? UnTableForm[ myTableF ] I may not have understood at all what you want, but the untable thing could be achieve with a *Case* function, as in the following example. myTableS = {{a, b}, {c, d}, {e, f}} myTableF = TableForm[myTableS, TableHeadings -> {{"r1", "r2", "r3"}, None}] First[Cases[myTableF, myTableS]] HTH, Jean-Marc > ---------- > > [Why would anyone want this? Well, now you can have a _single_ module > that creates a formatted table, which then carries _both_ its data and > its labels. You can run the module several times for different input > parameter values; Print[] the individual formatted tables with their > labels; or unformat them to ListPlot[] them, Join[] them, etc. > > One can envision a smarter Join[] command that would function for tables > like the DisplayTogether[] command does for plots, joining the data in a > set of formatted tables, then (as an option) restoring the formatting > options from the last table in the set to the joined tables.] >