Tables
Chapter 3 Tables and Spreadsheets
Create a table either by freezing an object view or by issuing a table declaration.
Creating a table from another object: combing the view and freeze commands. For example, if grp6.stats shows the stats view of the group grp6 then
freeze(name_of_table) grpt.stats create and displays a table and names it "name_of_table" which contains the contents of grp6.stats
NOTE if using commands do not create unnamed objects as they you will be unable to reference them.
Declaring a table: >> table(10, 20) name_of_table this creates a table with 10 rows, 20 columns and gives it a name.
NOTE: tables can be re-declared to a larger size without destroying data.
NOTE ALSO: tables are automatically expended if you try to add outside of their current size, this is different from matrices or vectors which throw an error.
The setcell command can be used to alter a single cell in a table.
setcell(name_of_table, row, col, content) For example >> setcell(tab1, 9, 12, %label) this sets whatever is associated with the string "%label" into row 9 column 12 of the table named tab1.
For tables we can center"c" right "r" or left "l" justify text setcell(big_tab, 1, 1, %label, "c") will set whatever is in %label to row 1 col 1 of big_tab and center justify the text.
Set width and hieight, formatting, fonts on PDF page 69 – 76.
Saving tables: >> tab1.save(t=csv, n = "NAN") name_of_saved_table Or
tab1.save(r=B2:C10, t=html, s=.05) c:\data\mytable2 can select rows and cols to save and also choose the destination of the file