Object Reference : Object View and Procedure Reference : Table
  
Table
 
String values
Scalar values
clearhist
clearremarks
comment
copy
copyrange
copytable
deletecells
deletecol
deleterow
display
displayname
fixcol
fixrow
fixrowcol
insertcells
insertcol
insertrow
insertrow
label
olepush
save
PDF Options
LaTeX Options
Excel Options
Excel 2007 Options
setattr
setfillcolor
setfont
setformat
setheight
setindent
setjust
setlines
setmerge
setprefix
setsuffix
settextcolor
setwidth
sheet
sort
table
title
transpose
Table object. Formatted two-dimensional table for output display.
Table Declaration
freeze freeze tabular view of object.
table create table object.
To declare a table object, use the keyword table, followed by an optional row and column dimension, and then the object name:
table onelement
table(10,5) outtable
If no dimension is provided, the table will contain a single element.
Alternatively, you may declare a table using an assignment statement. The new table will be sized and initialized, accordingly:
table newtable=outtable
Lastly, you may use the freeze command to create tables from tabular views of other objects:
freeze(newtab) ser1.freq
Table Views
display display table, graph, or spool in object window.
label label information for the table object.
sheet view the table.
table view the table.
Table Procs
clearhist clear the contents of the history attribute.
clearremarks clear the contents of the remarks attribute.
comment adds or removes a comment in a table cell.
copy creates a copy of the table.
copyrange copies a portion of the table to another table.
copytable copies the entire table to another table.
deletecells delete cells from a table.
deletecol remove columns from a table.
deleterow remove rows from a table.
displayname set display name.
fixcol fixes a set of columns to left of the spreadsheet view so that the leading columns are always in view.
fixrow fixes a set of rows at the top of the spreadsheet view so that the leading rows are always in view.
fixrowcol fixes a set of rows at the top and a set of columns to left of a spreadsheet view so that the leading rows and columns are always in view
insertcells insert cells into a table.
insertcol insert additional columns into a table.
insertrow insert additional rows into a table.
olepush push updates to OLE linked objects in open applications.
save save table as Excel 2007 XLSX, CSV, tab-delimited ASCII text, RTF, HTML, Enhanced Metafile, PDF, LaTeX, or Markdown file on disk.
setattr set the value of an object attribute.
setfillcolor set the fill (background) color of a set of table cells.
setfont set the font for the text in a set of table cells.
setformat set the display format of a set of table cells.
setheight set the row height in a set of table cells.
setindent set the indentation for a set of table cells.
setjust set the justification for cells in the table.
setlines set the line characteristics and borders for a set of table cells.
setmerge merge or unmerge a set of table cells.
setprefix set the cell prefix string for the specified table cells.
setsuffix set the cell suffix string for the specified table cells.
settextcolor set the text color in a set of table cells.
setwidth set the column width for a set of table cells.
sort sort the rows of the specified selection of cells.
title assign or change the title of a table.
transpose transposes a set of cells in the table.
Table Data Members
String values
(i,j) the (i,j)-th element of the table, formatted as a string.
@attr("arg") string containing the value of the arg attribute, where the argument is specified as a quoted string.
@description string containing the Table object’s description (if available).
@detailedtype string with the object type: “TABLE”.
@displayname string containing the Table object’s display name. If the Table has no display name set, the name is returned.
@find("arg") string containing the cell identifiers meeting the boolean argument. This argument can be a mathematical or string expression. For example:
string s = tab1.@find("[b1:c15]>0.3")
returns a list of cells between B1 and C15 greater than 0.3;
string s = tabl1.@find("[a1:e67]== ""1949q4""")
returns a list of cells between A1 and E67 matching the string “1949q4” (string comparisons in @find ignore case);
string s = tab1.@find("[@all]==0.5")
returns a list of cells in the table equal to 0.5;
string s = t.@find("@instr([@all],""in"")")
returns a list of cells in the table containing the substring ‘in’;
string s = t.@find("[b3:c5]<[d5]")
returns a list of cells between B3 and C5 less than cell D5;
string s = t.@find("@left([@all],1)==""cp"")
returns a list of cells starting with “cp”.
(See “Conditional Table Cells” in Command and Programming Reference for syntax discussion.)
@name string containing the Table object’s name.
@remarks string containing the Table object’s remarks (if available).
@title string containing the Table object’s title (if available).
@type string with the object type: “TABLE”.
@updatetime string representation of the time and date at which the Table was last updated.
Scalar values
@cols number of columns in the table.
@colwidth(i) the column width of the i-th column in the table.
@rowheight(i) the row height of the i-th row in the table.
@rows number of rows in the table.
@val(i,j) the numerical value of the (i,j)-th element of the table.
Table Commands
setcell format and fill in a table cell.
setcolwidth set width of a table column.
setline place a horizontal line in table.
tabplace insert a table into another table.
Note that with the exception of tabplace, these commands are supported primarily for backward compatiblity. There is a more extensive set of table procs for working with and customizing tables. See “Table Procs”.
Table Examples
table(5,5) mytable
%strval = mytable(2,3)
mytable(4,4) = "R2"
mytable(4,5) = @str(eq1.@r2)
clearhist
Clear the contents of the history attribute.
Removes the table’s history attribute, as shown in the label view of the table.
Syntax
table_name.clearhist
Examples
t1.clearhist
t1.label
The first line removes the history from the table T1, and the second line displays the label view of T1, including the now blank history field.
Cross-references
See “Labeling Objects” for a discussion of labels and display names.
See also Table::label.
clearremarks
Clear the contents of the remarks attribute.
Removes the table’s remarks attribute, as shown in the label view of the table.
Syntax
table_name.clearremarks
Examples
t1.clearremarks
t1.label
The first line removes the remarks from the table T1, and the second line displays the label view of T1, including the now blank remarks field.
Cross-references
See “Labeling Objects” for a discussion of labels and display names.
See also Table::label.
comment
Adds or removes a comment in a table cell.
Syntax
table_name.comment(cell_arg) [comment_arg]
where cell_arg, which identifies the cell, can take one of the following forms:
cell
Cell identifier. You can reference cells using either the column letter and row number (e.g., “A1”), or by using “R” followed by the row number followed by “C” and the column number (e.g., “R1C2”).
row[,] col
Row number, followed by column letter or number (e.g., “2,C”, or “2,3”), separated by “,”.
and where comment_arg is a string expression enclosed in double quotes. If command_arg is omitted, a previously defined comment will be removed.
Examples
To add a comment, “hello world”, to the cell in the second row, fourth column, you may use one of the following:
tab1.comment(d2) "hello world"
tab1.comment(r2c4) "hello world"
tab1.comment(2,d) "hello world"
tab1.comment(2,4) "hello world"
To remove a comment, simply omit the comment_arg:
tab1.comment(d2)
clears the comment (if present) from the second row, fourth column.
Cross-references
For additional discussion of table commands see “Working with Tables and Spreadsheets”. See also Table::setlines and Table::setmerge.
copy
Creates a copy of the table.
Creates either a named or unnamed copy of the table.
Syntax
table_name.copy
table_name.copy dest_name
Examples
t1.copy
creates an unnamed copy of the table T1.
t1.copy t2
creates T2, a copy of the table T1.
Cross-references
See also copy.
copyrange
Copies a portion of the table to the specified location in another table.
Syntax
table_name.copyrange(options) s1 s2 destname d1
table_name.copyrange(options) sr1 sc1 sr2 sc2 destname dr1 dc1
Options
Options are specified in parentheses after the keyword and are used to specify the format of the data in the destination table.
t
Places a transpose of the selected data into the destination area. The default is not transposed.
The copyrange command can be specified either using coordinates where columns are signified with a letter, and rows by a number (for example “A3” represents the first column, third row), or by row number and column number.
The first syntax represents coordinate form, where s1 specifies the upper-left coordinate portion of the section of the source table to be copied, s2 specifies the bottom-right coordinate, destname specifies the name of the table to copy to, and d1 specifies the upper-left coordinate of the destination table.
The second syntax represents the row/column number form, where sr1 specifies the source table upper row number, sc1 specifies the source table left most column number, sr2 specifies the source table bottom row number, sc2 specifies the source table right most column number. destname specifies the name of the table to copy to, and dr1 and dr2 specify the upper and left most row and column of the destination table, respectively.
Examples
table1.copyrange B2 D4 table2 A1
places a copy of the data from cell range B2 to D4 in TABLE1 to TABLE2 at cell A1
table1.copyrange(t) 1 1 1 5 table2 1 3
copies 5 rows of data in the first column of data in table1 and places a transpose of the data at the top of the 3rd column of TABLE2.
Cross-references
See also Table::copytable.
For additional discussion of table commands see “Working with Tables and Spreadsheets”.
See also “Table and Text Objects” for a discussion and examples of table formatting in EViews.
copytable
Copies the entire table to the specified location in another table.
Syntax
table_name.copytable destname d1
table_name.copytable destname dr1 dc1
The copytable command can be specified either using coordinates where columns are signified with a letter, and rows by a number (for example “A3” represents the first column, third row), or by row number and column number.
The first syntax represents coordinate form, where destname specifies the name of the table to copy to, and d1 specifies the upper-left coordinate of the destination table.
The second syntax represents the row/column number form, where destname specifies the name of the table to copy to, and dr1 and dr2 specify the upper and left most row and column of the destination table, respectively.
Examples
table1.copytable table2 A10
copies all of the data in TABLE1 to the 1st column and 10th row of TABLE2.
table1.copytable table2 1 5
copies all of the data in TABLE1 to the 5th column and first row of TABLE2.
Cross-references
See also Table::copyrange.
For additional discussion of table commands see “Working with Tables and Spreadsheets”.
See also “Table and Text Objects” for a discussion and examples of table formatting in EViews.
deletecells
Delete cells from a table.
Syntax
table_name.deletecells(cell_range) delete_arg
where delete_arg specifies what to delete or how the surrounding cells should be moved.
The cell_range argument defines the cells to be modified. See Table::setformat for the syntax.
delete_arg may be one of the following:
row
Delete row.
column
Delete column.
left
Shift cells to right of cell_range to the left after cells have been deleted.
up
Shift cells below cell_range up after cells have been deleted.
Examples
tab1.deletecells(2:5) row
deletes rows 2 through 5 from the table TAB1.
tab1.deletecells(B2:E5) left
deletes cells B2 through E5 from the table TAB1 and moves all the cells right of and including F2 and F5 to the left in place of B2 and B5 respectively.
tab1.deletecells(B2:E5) up
deletes cells B2 through E5 from the table TAB1 and moves all the cells below and including B5 and F5 up in place of B2 and E5 respectively.
You may delete cells conditionally. For example, to delete the cell e17 if cell b3 is less than c4 and shift the remaining cells in the row to the left:
tab1.deletecells(e17 if [b3]<[c4]) left
Or to delete the range of cells from c7 to d17 if cell b3 is greater than c4 and shift the remaining cells to the left:
tab1.deletecells(c7:d17 if [b3]>[c4]) left
Cross-references
For additional discussion of table commands see “Working with Tables and Spreadsheets”.
deletecol
Removes columns from a table.
Syntax
table_name.deletecol(col_loc) [num_cols]
where col_loc specifies the first column to be removed. The col_loc may either be the integer column number (e.g. “3”) or the column letter (e.g. “C”).
The num_cols specifies the number of columns to remove from the table. If num_cols is not provided, the default is one.
Examples
tab1.deletecol(d) 2
removes two columns beginning at the “d” or fourth column.
Cross-references
For other row and columns operations, see Table::deleterow, Table::insertcol, and Table::insertrow.
For additional discussion of table commands see “Working with Tables and Spreadsheets”.
See also “Table and Text Objects” for a discussion and examples of table formatting in EViews.
deleterow
Removes rows from a table.
Syntax
table_name.deleterow(row_loc) [num_rows]
where row_loc is an integer which specifies the first row to remove, and num_rows specifies the number of rows to remove from the table. If num_rows is not provided, the default is one.
Examples
tab1.deleterow(2) 5
removes five rows beginning with the second row.
Cross-references
For other row and columns operations, see Table::deletecol, Table::insertcol, and Table::insertrow.
For additional discussion of table commands see “Working with Tables and Spreadsheets”.
See also “Table and Text Objects” for a discussion and examples of table formatting in EViews.
display
Display table, graph, or spool output in the table object window.
Display the contents of a table, graph, or spool in the window of the table object.
Syntax
table_name.display object_name
Examples
table1.display tab1
Display the contents of the table TAB1 in the window of the object TABLE1.
Cross-references
See “Labeling Objects” for a discussion of labels and display names. See also Table::label.
displayname
Display name for table objects.
Attaches a display name to a table object which may be used to label output in place of the standard table object name.
Syntax
table_name.displayname display_name
Display names are case-sensitive, and may contain a variety of characters, such as spaces, that are not allowed in table object names.
Examples
hrs.displayname Hours Worked
hrs.label
The first line attaches a display name “Hours Worked” to the table object HRS, and the second line displays the label view of HRS, including its display name.
Cross-references
See “Labeling Objects” for a discussion of labels and display names.
See also Table::label.
fixcol
Fixes a set of columns to left of the spreadsheet view of a table object so that the leading columns are always in view.
Syntax
table_name.fixcol cols
where cols is the number of columns to be fixed
Example
tab1.fixcol 3
fixes the first 3 columns of the table TAB1 such that they are always in view despite the horizontal scroll position.
tab1.fixcol 0
removes any fixed columns in table TAB1.
Cross-references
See also Table::fixrow and Table::fixrowcol.
fixrow
Fixes a set of rows at the top of the spreadsheet view of a table object so that the leading rows are always in view.
Syntax
table_name.fixrow rows
where rows is the number of rw to be fixed
Example
tab1.fixrow 2
fixes the first 2 rows of the table TAB1 such that they are always in view despite the vertical scroll position.
tab1.fixrow 0
removes any fixed rows in table TAB1.
Cross-references
See also Table::fixcol and Table::fixrowcol.
fixrowcol
Fixes a set of rows at the top and a set of columns to left of a spreadsheet view of a table object so that the leading rows and columns are always in view.
Syntax
table_name.fixrowcol rows cols
where rows is the number of rows to be fixed and cols is the number of columns to be fixed.
Example
tab1.fixrowcol 1 4
fixes the first row and the first 4 columns of the table TAB1 such that they are always in view despite the horizontal and vertical scroll position of the table.
tab1.fixrowcol 0 0
removes all fixed rows and columns in table TAB1.
tab1.fixrowcol 0 4
in table TAB1 removes all fixed rows but fixes the first 4 columns.
Cross-references
See also Table::fixcol and Table::fixrow.
insertcells
Inserts cells into a table.
Syntax
table_name.insertcells(cell_range) insert_arg
where insert_arg specifies what to be inserted or how the surrounding cells should be shifted.
The cell_range argument defines the cells to be modified. See Table::setformat for the syntax.
insert_arg may be one of the following:
row
Insert row.
column
Insert column.
right
Shift cells in cell_range to the right before inserting new cells.
down
Shift cells below cell_range down before inserting new cells.
Examples
tab1.insertcells(2:5) row
inserts four new rows starting at row 2 in the table TAB1.
tab1.insertcells(B2:E5) right
shifts the cells to the right of and including B2 through E5 in table TAB1 by four columns.
tab1.insertcells(B2:E5) down
shifts the cells below and including B2 through E5 in table TAB1 by four rows.
Cross-references
For additional discussion of table commands see “Working with Tables and Spreadsheets”.
insertcol
Insert additional columns in a table.
Syntax
table_name.insertcol(col_loc) [num_cols]
where col_loc specifies the column location to insert the new columns. The col_loc may either be the integer column number (e.g. “3”) or the column letter (e.g. “C”).
The num_cols specifies the number of columns to insert into the table. If num_cols is not provided, the default is one.
Examples
tab1.insertcol(d) 2
inserts two new columns beginning at the “d” or fourth column.
You may do conditional column insertions. This will insert four columns after each column from b to d if cell b7 is greater than each cell f7 to h7:
tab1.insertcol(b:d if [b7] > [f7:h7]) 4
Cross-references
For other row and columns operations, see Table::deleterow, Table::deletecol, and Table::insertrow.
For additional discussion of table commands see “Working with Tables and Spreadsheets”.
See also “Table and Text Objects” for a discussion and examples of table formatting in EViews.
insertrow
Insert additional rows in a table.
Syntax
table_name.insertrow(row_loc) [num_rows]
where row_loc is an integer which specifies the row location to insert the new rows, and num_rows specifies the number of rows to insert. If num_rows is not provided, the default is one.
Examples
tab1.insertrow(2) 5
inserts five new rows beginning at the second row.
You may do conditional row insertions. This will insert four rows after each row from b to d if cell b7 is greater than each cell f7 to h7:
tab1.insertrow(b:d if [b7] > [f7:h7]) 4
Cross-references
For other row and columns operations, see Table::deleterow, Table::deletecol, and Table::insertcol.
For additional discussion of table commands see “Working with Tables and Spreadsheets”.
See also “Table and Text Objects” for a discussion and examples of table formatting in EViews.
insertrow
Insert additional rows in a table.
Syntax
table_name.insertrow(row_loc) [num_rows]
where row_loc is an integer which specifies the row location to insert the new rows, and num_rows specifies the number of rows to insert. If num_rows is not provided, the default is one.
Examples
tab1.insertrow(2) 5
inserts five new rows beginning at the second row.
Cross-references
For other row and columns operations, see Table::deleterow, Table::deletecol, and Table::insertcol.
For additional discussion of table commands see “Working with Tables and Spreadsheets”.
See also “Table and Text Objects” for a discussion and examples of table formatting in EViews.
label
Display or change the label view of the table object, including the last modified date and display name (if any).
As a procedure, label changes the fields in the table label.
Syntax
table_name.label
table_name.label(options) [text]
Options
The first version of the command displays the label view of the table. The second version may be used to modify the label. Specify one of the following options along with optional text. If there is no text provided, the specified field will be cleared.
c
Clears all text fields in the label.
d
Sets the description field to text.
s
Sets the source field to text.
u
Sets the units field to text.
r
Appends text to the remarks field as an additional line.
p
Print the label view.
Examples
The following lines replace the remarks field of the table TAB1 with “Data from CPS 1988 March File”:
tab1.label(r)
tab1.label(r) Data from CPS 1988 March File
To append additional remarks to TAB1, and then to print the label view:
tab1.label(r) Log of hourly wage
tab1.label(p)
To clear and then set the units field, use:
tab1.label(u) Millions of bushels
Cross-references
See “Labeling Objects” for a discussion of labels.
See also Table::displayname.
olepush
Push updates to OLE linked objects in open applications.
Syntax
table_name.olepush
Cross-references
See “Object Linking and Embedding (OLE)” for a discussion of using OLE with EViews.
save
Save table to disk as an Excel 2007 XLSX, CSV, tab-delimited ASCII text, RTF, HTML, Enhanced Metafile, LaTeX, PDF, or Markdown file.
Syntax
table_name.save(options) [path\]file_name
Follow the keyword with a name for the file. file_name may include the file type extension, or the file type may be specified using the “t=” option.
If an explicit path is not specified, the file will be stored in the default directory, as set in the File Locations global options.
The base syntax for writing Excel files is:
table_name.save(options) [path\]file_name [table_description]
where the following table_description elements may be employed:
“range = arg”, where arg is top left cell of the destination Excel workbook, following the standard Excel format [worksheet!][topleft_cell[:bottomright_cell]].
If the worksheet name contains spaces, it should be placed in single quotes. If the worksheet name is omitted, the cell range is assumed to refer to the currently active sheet. If only a top left cell is provided, a bottom right cell will be chosen automatically to cover the range of non-empty cells adjacent to the specified top left cell. If only a sheet name is provided, the first set of non-empty cells in the top left corner of the chosen worksheet will be selected automatically. As an alternative to specifying an explicit range, a name which has been defined inside the excel workbook to refer to a range or cell may be used to specify the cells to read.
Options
t=file_type (default=“csv”)
Specifies the file type, where file_type may be one of: “excelxml” (Excel 2007 (xml)),“csv” (CSV - comma-separated), “rtf” (Rich-text format), “txt” (tab-delimited text), “html” (HTML - Hypertext Markup Language), “emf” (Enhanced Metafile), “pdf” (PDF - Portable Document Format), “tex” (LaTeX), or “md” (Markdown).
Files will be saved with the “.xlsx”, “.csv”, “.rtf”, “.txt”, “.htm”, “.emf”, “.pdf”, “.tex”, or “.md” extensions, respectively.
s=arg
Scale size, where arg is from 5 to 200, representing the percentage of the original table size (only valid for HTML or RTF files).
r=cell_range
Range of table cells to be saved. See Table::setfillcolor for the cell_range syntax. If a range is not provided, the entire table will be saved.
n=string
Replace all cells that contain NA values with the specified string. “NA” is the default.
f / -f
[Use full precision values/ Do not use full precision] when saving values to the table (only applicable to numeric cells). By default, the values will be saved as they appear in the currently formatted table.
prompt
Force the dialog to appear from within a program.
PDF Options
landscape
Save in landscape mode (the default is to save in portrait mode).
size=arg (default=“letter”)
Page size: “letter”, “legal”, “a4”, and “custom”.
width=number (default=8.5)
Page width in inches if “size=custom”.
height=number (default=11)
Page height in inches if “size=custom”.
leftmargin=number (default=0.5)
Left margin width in inches.
rightmargin=number (default = 0.5)
Right margin width in inches.
topmargin=number (default=1)
Top margin width in inches.
bottommargin= number (default = 1)
Bottom margin width in inches.
LaTeX Options
texspec / -texspec
[Include / Do not include] the full LaTeX documentation specification in the LaTeX output. The default behavior is taken from the global default settings.
Excel Options
mode=arg
Specify whether to create a new file, overwrite an existing file, or update an existing file. arg may be “create” (create new file only; error on attempt to overwrite) or “update” (update an existing file, only overwriting the area specified by the range= table_description).
If the “mode=” option is not used, EViews will create a new file, unless the file already exists in which case it will overwrite it.
Note that the “mode=update” option is only available for Excel in 1) Excel versions through 2003, if Excel is installed, and 2) Excel 2007 (xml). Note: Excel does not need to be installed for Excel 2007 writing.
Excel 2007 Options
cellfmt=arg
Specify whether to use EViews, pre-existing, or remove cell formatting (colors, font, number formatting when possible, column widths and row heights) for the written range.
arg may be “eviews” (replace current formatting in the file with the same cell formatting in EViews), “preserve” (leave current cell formatting already in the Excel file), or “clear” (remove current formatting and do not replace).
strlen=arg
(default = 256)
Specify the maximum the number of characters written for cells containing text. Strings in cells which are longer the max, will be truncated.
Examples
The command:
tab1.save mytable
saves TAB1 to a CSV file named “mytable.CSV” in the default directory.
tab1.save(t=csv, n="NaN") mytable
saves TAB1 to a CSV (comma separated value) file named “mytable.csv” and writes all NA values as “NaN”.
tab1.save(r=B2:C10, t=html, s=50) mytable
saves from data from the second row, second column, to the tenth row, third column of TAB1 to a HTML file named “mytable.HTM” at half of the original size.
tab1.save(f, n=".", r=B) mytable
saves the contents of the second column of the table in full precision to a CSV file named “mytable.CSV”, and writes all NA values as “.”.
tab1.save(t=excelxml, cellfmt=eviews, mode=update) mytable range=Country!b5
adds TAB1 to the preexisting “mytable.XLSX” Excel file to the “Country” sheet at cell B5, where the cell colors and fonts in TAB1 will also be copied.
Cross-references
For additional discussion of table commands see “Working with Tables and Spreadsheets”.
See “Table and Text Objects” for a discussion of tables.
setattr
Set the object attribute.
Syntax
table_name.setattr(attr) attr_value
Sets the attribute attr to attr_value. Note that quoting the arguments may be required. Once added to an object, the attribute may be extracted using the @attr data member.
Examples
a.setattr(revised) never
String s = a.@attr("revised")
sets the “revised” attribute in the object A to the string “never”, and extracts the attribute into the string object S.
Cross-references
See “Adding Custom Attributes in the Label View” and “Adding Your Own Label Attributes”.
setfillcolor
Set the fill (background) color of the specified table cells.
Syntax
table_name.setfillcolor(cell_range, options) color_arg
where cell_range can take one of the following forms:
@all
Apply to all cells in the table.
cell
Cell identifier. You can identify cells using either the column letter and row number (e.g., “A1”), or by using “R” followed by the row number followed by “C” and the column number (e.g., “R1C2”).You can optionally add an ‘if’ condition to the identifier. Without the ‘if’ condition, the formatting will be applied to all the identified cells. If an ‘if’ condition is supplied, the formatting will be applied to all the identified where the ‘if’ condition is true. The ‘if’ condition must be followed by a boolean expression.
row[,] col
Row number, followed by column letter or number (e.g., “2,C”, or “2,3”), separated by “,”. Apply to cell.
row
Row number (e.g., “2”). Apply to all cells in the row.
col
Column letter (e.g., “B”). Apply to all cells in the column.
first_cell[:]last_cell, first_cell[,]last_cell
Top left cell of the selection range (specified in “cell” format), followed by bottom right cell of the selection range (specified in “cell” format), separated by a “:” or “,” (e.g., “A2:C10”, “A2,C10”, or “R2C1:R10C3”, “R2C1,R10C3”). Apply to all cells in the rectangular region defined by the first cell and last cell.
first_cell_row[,] first_cell_col[,] last_cell_row[,] last_cell_col
Top left cell of the selection range (specified in “row[,] col” format), followed by bottom right cell of the selection range (specified in “row[,] col” format), separated by a “,” (e.g., “2,A,10,C” or “2,1,10,3”). Apply to all cells in the rectangular region defined by the first cell and last cell.
The color_arg specifies the color to be applied to the text in the cells. The color may be specified using predefined color names, by specifying the individual red-green-blue (RGB) components using the special “@RGB” function, or by specifying the individual red-green-blue (RGB) components in hexadecimal using the special “@HEX” function. The second and third methods are obviously more difficult, but allow you to use custom colors.
The predefined colors are given by the keywords (with their RGB and HEX equivalents):
blue
@rgb(0, 0, 255)
@hex(0000ff)
red
@rgb(255, 0, 0)
@hex(ff0000)
ltred
@rgb(255, 168, 168)
@hex(ffa8a8)
green
@rgb(0, 128, 0)
@hex(008000)
black
@rgb(0, 0, 0)
@hex(000000)
white
@rgb(255, 255, 255)
@hex(ffffff)
purple
@rgb(128, 0, 128)
@hex(800080)
orange
@rgb(255, 128, 0)
@hex(ff8000)
yellow
@rgb(255, 255, 0)
@hex(ffff00)
gray
@rgb(128, 128, 128)
@hex(808080)
ltgray
@rgb(192, 192, 192)
@hex(c0c0c0)
Options
mode=arg
Color mode: “Alt” (alternate and color every other row in the cell_range); “All” (color every row in the cell_range).
Examples
To set a purple background color for the cell in the second row and third column of TAB1, you may use any of the following:
tab1.setfillcolor(C2) @rgb(128, 0, 128)
tab1.setfillcolor(2,C) @HEX(808080)
tab1.setfillcolor(2,3) purple
tab1.setfillcolor(r2c3) purple
You may also specify a yellow color for the background of an entire column, or an entire row:
tab1.setfillcolor(C) @RGB(255, 255, 0)
tab1.setfillcolor(2) yellow
or for every other row, the background of the cells in a rectangular region:
tab1.setfillcolor(R2C3:R3C6, mode=alt) ltgray
tab1.setfillcolor(2,C,3,F, mode=alt) @rgb(192, 192, 192)
tab1.setfillcolor(2,3,3,6, mode=alt) @hex(c0c0c0)
You may conditionally set the fill color for a range of cells. For example, in the below command cells a3 to a18 will be yellow if the sum from a second range of cells (b4 to b19) added to a third range of cells (c4 to c19) is greater than 0.5. Specifically, cell a3 will be set to yellow if cell b4 plus cell c4 is greater than 0.5:
tab1.setfillcolor(a3:a18 if [b4:b19]+[c4:c19] > .5) yellow
Cross-references
See Table::settextcolor and Table::setfont for details on changing text color and font, and Table::setlines for drawing lines between and through cells.
For additional discussion of table commands see “Working with Tables and Spreadsheets”.
See also “Table and Text Objects” for a discussion and examples of table formatting in EViews.
setfont
Set the font for text in the specified table cells.
Syntax
table_name.setfont(cell_range) font_args
The font_args may include one or more of the following:
type([face], [pt], [+/- b], [+/- i], [+/- u], [+/- s])
Set characteristics of the font for the graph element type. The font name (face), size (pt), and characteristics are all optional. face should be a valid font name, enclosed in double quotes. pt should be the font size in points. The remaining options specify whether to turn on/off boldface (b), italic (i), underline (u), and strikeout (s) styles.
and type is one of “all”, “axes”, “legend”, “text”, “obs”, where “axes” refers to the axes labels, “legend” refers to the graph legend, “text” refers to the text objects, “obs” refers to the observation scale, and “all” refers to all of the elements.
Examples
tab1.setfont(B3:D10) "Times New Roman" +i
sets the font to Times New Roman Italic for the cells defined by the rectangle from B3 (row 3, column 2) to D10 (row 10, column 4).
tab1.setfont(3,B,10,D) 8pt
changes all of text in the region to 8 point.
tab1.setfont(4,B) +b -i
removes the italic, and adds boldface to the B4 cell (row 4, column 2).
The commands:
tab1.setfont(b) -s +u 14pt
tab1.setfont(2) "Batang" 14pt +u
modify the fonts for the column B, and row 2, respectively. The first command changes the point size to 14, removes strikethrough and adds underscoring. The second changes the typeface to Batang, and adds underscoring,
Cross-references
See Table::settextcolor and Table::setfillcolor for details on changing text color and font, and Table::setlines for drawing lines between and through cells.
For additional discussion of table commands see “Working with Tables and Spreadsheets”.
See also “Table and Text Objects” for a discussion and examples of table formatting in EViews.
setformat
Set the display format for cells in a table view.
Syntax
table_name.setformat(cell_range) format_arg
where format_arg is a set of arguments used to specify format settings. If necessary, you should enclose the format_arg in double quotes.
The cell_range option is used to describe the cells to be modified. It may take one of the following forms:
@all
Apply to all cells in the table.
cell
Cell identifier. You can identify cells using either the column letter and row number (e.g., “A2”), or by using “R” followed by the row number followed by “C” and the column number (e.g., “R1C2”).You can optionally add an ‘if’ condition to the identifier. Without the ‘if’ condition, the formatting will be applied to all the identified cells. If an ‘if’ condition is supplied, the formatting will be applied to all the identified where the ‘if’ condition is true. The ‘if’ condition must be followed by a boolean expression.
row[,] col
Row number, followed by column letter or number (e.g., “2,C”, or “2,3”), separated by “,”. Apply to cell.
row
Row number (e.g., “2”). Apply to all cells in the row.
col
Column letter (e.g., “B”). Apply to all cells in the column.
first_cell[:]last_cell, first_cell[,]last_cell
Top left cell of the selection range (specified in “cell” format), followed by bottom right cell of the selection range (specified in “cell” format), separated by a “:” or “,” (e.g., “A2:C10”, “A2,C10”, or “R2C1:R10C3”, “R2C1,R10C3”). Apply to all cells in the rectangular region defined by the first cell and last cell.
first_cell_row[,] first_cell_col[,] last_cell_row[,] last_cell_col
Top left cell of the selection range (specified in “row[,] col” format), followed by bottom right cell of the selection range (specified in “row[,] col” format), separated by a “,” (e.g., “2,A,10,C” or “2,1,10,3”). Apply to all cells in the rectangular region defined by the first cell and last cell.
To format numeric values, you should use one of the following format specifications:
g[.precision]
significant digits
f[.precision]
fixed decimal places
c[.precision]
fixed characters
e[.precision]
scientific/float
p[.precision]
percentage
r[.precision]
fraction
To specify a format that groups digits into thousands using a comma separator, place a “t” after the format character. For example, to obtain a fixed number of decimal places with commas used to separate thousands, use “ft[.precision]”.
To use the period character to separate thousands and commas to denote decimal places, use “..” (two periods) when specifying the precision. For example, to obtain a fixed number of characters with a period used to separate thousands, use “ct[..precision]”.
If you wish to display negative numbers surrounded by parentheses (i.e., display the number -37.2 as “(37.2)”), you should enclose the format string in “()” (e.g., “f(.8)”).
To format numeric values using date and time formats, you may use a subset of the possible date format strings (see “Date Formats”). The possible format arguments, along with an example of the date number 730856.944793113 (January 7, 2002 10:40:30.125 p.m) formatted using the argument are given by:
WF
(uses current EViews workfile period display format)
YYYY
“2002”
YYYY-Mon
“2002-Jan”
YYYYMon
“2002 Jan”
YYYY[M]MM
“2002[M]01”
YYYY:MM
“2002:01”
YYYY[Q]Q
“2002[Q]1”
YYYY:Q
“2002:Q
YYYY[S]S
“2002[S]1” (semi-annual)
YYYY:S
“2002:1”
YYYY-MM-DD
“2002-01-07”
YYYY Mon dd
“2002 Jan 7”
YYYY Month dd
“2002 January 7”
YYYY-MM-DD HH:MI
“2002-01-07 22:40”
YYYY-MM-DD HH:MI:SS
“2002-01-07 22:40:30”
YYYY-MM-DD HH:MI:SS.SSS
“2002-01-07 22:40:30.125”
Mon-YYYY
“Jan-2002”
Mon dd YYYY
“Jan 7 2002”
Mon dd, YYYY
“Jan 7, 2002”
Month dd YYYY
“January 7 2002”
Month dd, YYYY
“January 7, 2002”
MM/DD/YYYY
“01/07/2002”
mm/DD/YYYY
“1/07/2002”
mm/DD/YYYY HH:MI
“1/07/2002 22:40”
mm/DD/YYYY HH:MI:SS
“1/07/2002 22:40:30”
mm/DD/YYYY HH:MI:SS.SSS
“1/07/2002 22:40:30.125”
mm/dd/YYYY
“1/7/2002”
mm/dd/YYYY HH:MI
“1/7/2002 22:40”
mm/dd/YYYY HH:MI:SS
“1/7/2002 22:40:30”
mm/dd/YYYY HH:MI:SS.SSS
“1/7/2002 22:40:30.125”
dd/MM/YYYY
“7/01/2002”
dd/mm/YYYY
“7/1/2002”
DD/MM/YYYY
“07/01/2002”
dd Mon YYYY
“7 Jan 2002”
dd Mon, YYYY
“7 Jan, 2002”
dd Month YYYY
“7 January 2002”
dd Month, YYYY
“7 January, 2002”
dd/MM/YYYY HH:MI
“7/01/2002 22:40”
dd/MM/YYYY HH:MI:SS
“7/01/2002 22:40:30”
dd/MM/YYYY HH:MI:SS.SSS
“7/01/2002 22:40:30.125”
dd/mm/YYYY hh:MI
“7/1/2002 22:40”
dd/mm/YYYY hh:MI:SS
“7/1/2002 22:40:30”
dd/mm/YYYY hh:MI:SS.SSS
“7/1/2002 22:40:30.125”
hm:MI am
“10:40 pm“
hm:MI:SS am
“10:40:30 pm”
hm:MI:SS.SSS am
“10:40:30.125 pm”
HH:MI
“22:40”
HH:MI:SS
“22:40:30”
HH:MI:SS.SSS
“22:40:30.125”
hh:MI
“22:40”
hh:MI:SS
“22:40:30”
hh:MI:SS.SSS
“22:40:30.125”
Note that the “hh” formats display 24-hour time without leading zeros. In our examples above, there is no difference between the “HH” and “hh” formats for 10 p.m.
Also note that all of the “YYYY” formats above may be displayed using two-digit year “YY” format.
Examples
To set the format of a cell to fixed 5-digit precision, provide the format specification and a valid cell specification:
tab1.setformat(A2) f.5
You may use any of the date formats given above:
tab1.setformat(A3) YYYYMon
tab1.setformat(B1) "YYYY-MM-DD HH:MI:SS.SSS"
The cell specification may be described in a variety of ways:
tab1.setformat(B2) hh:MI:SS.SSS
tab1.setformat(2,B,10,D) g(.3)
tab1.setformat(R2C2:R4C4) "dd/MM/YY HH:MI:SS.SSS"
You may conditionally set the format for a range of cells. For example, in the command below the cells from b20 to d25 will use format ‘e.5’ if the matching cells from the second range (b20 to d25) are greater than the cells from the third range (f10 to h15). Specifically, the format for cell b20 will be set to 'e.5' if cell b20 is greater than f10:
tab1.setformat(b20:d25 if [b20:d25] > [f10:h15]) e.5
Cross-references
See Table::settextcolor and Table::setfillcolor for details on changing text color, and Table::setlines for drawing lines between and through cells. To set other cell properties, see Table::setheight, Table::setindent, Table::setjust, and Table::setwidth.
For additional discussion of table commands see “Working with Tables and Spreadsheets”.
See also “Table and Text Objects” for a discussion and examples of table formatting in EViews.
setheight
Set the row height of rows in a table.
Syntax
table_name.setheight(row_range) height_arg
where row_range is either a single row number (e.g., “5”), a colon delimited range of rows (from low to high, e.g., “3:5”), or the “@ALL” keyword, and height_arg specifies the height unit value, where height units are specified in character heights. The character height is given by the font-specific sum of the units above and below the baseline and the leading, where the font is given by the default font for the current table (the EViews table default font at the time the table was created). height_arg values may be non-integer values with resolution up to 1/10 of a height unit.
Examples
tab1.setheight(2) 1
sets the height of row 2 to match the table font character height, while:
tab1.setheight(2) 1.5
increases the row height to 1-1/2 character heights.
Similarly, the command:
tab1.setheight(2:4) 1
sets the heights for rows 2 through 4.
You many conditionally set the row height. This command will set the individual row height of rows 10 through 15 to 2 if the cells in column b (cells b20 to b25) are greater than the cells in column f (cells f10 to f15). Specifically, the row height of row 10 will be set to 2 if cell b20 is greater than f10:
tab1.setheight(10:15 if [b20:b25] > [f10:f15]) 2
Cross-references
See Table::setwidth, Table::setindent and Table::setjust for details on setting table widths, indentation and justification.
For additional discussion of table commands see “Working with Tables and Spreadsheets”.
See also “Table and Text Objects” for a discussion and examples of table formatting in EViews.
setindent
Set the display indentation for a table view.
Syntax
table_name.setindent(cell_range) indent_arg
where indent_arg is an indent value specified in 1/5 of a width unit. The width unit is computed from representative characters in the default font for the current table (the EViews table default font at the time the table was created), and corresponds roughly to a single character. Indentation is only relevant for non-center justified cells.
The default values are taken from the settings at the time the table is created.
The cell_range defines the cells to be modified. See Table::setformat for the syntax for cell_range specifications.
Examples
To set the justification, provide a valid cell specification:
tab1.setindent(@all) 2
tab1.setindent(2,B,10,D) 4
tab1.setindent(R2C2:R4C4) 2
Cross-references
See Table::setwidth, Table::setheight and Table::setjust for details on setting table widths, height, and justification.
For additional discussion of table commands see “Working with Tables and Spreadsheets”.
See also “Table and Text Objects” for a discussion and examples of table formatting in EViews.
setjust
Set the justification for cells in the table.
Syntax
table_name.setjust(cell_range) format_arg
where format_arg may consist of the following:
top / middle / bottom
Vertical justification setting.
auto / left / center / right
Horizontal justification setting. Strings are left-justified and numbers are right-justified under “auto”.
The default settings are taken from the original view when created by freezing a view, or as “middle bottom” for newly created tables.
The cell_range defines the cells to be modified. See Table::setformat for syntax.
Examples
To set the justification, you must provide a valid cell specification:
tab1.setjust(@all) top
tab1.setjust(2,B,10,D) left bottom
tab1.setjust(R2C2:R4C4) right top
Cross-references
See Table::setwidth, Table::setheight, and Table::setindent for details on setting table widths, height and indentation.
For additional discussion of table commands see “Working with Tables and Spreadsheets”.
See also “Table and Text Objects” for a discussion and examples of table formatting in EViews.
setlines
Sets line characteristics and borders for a set of table cells.
Syntax
table_name.setlines(cell_range) line_args
where cell_range describes the table cells to be modified, and line_args is a set of arguments used to modify the existing line settings. See Table::setfillcolor for the syntax for cell_range.
The line_args may contain one or more of the following:
+t / -t
Top border [on/off].
+b / -b
Bottom border [on/off].
+l / -l
Left border [on/off].
+r / -r
Right border [on/off].
+i / -i
Inner borders [on/off].
+o / -o
Outer borders [on/off].
+v / -v
Vertical inner borders [on/off].
+h / -h
Horizontal inner borders [on/off].
+a / -a
All borders [on/off].
+d / -d
Double middle lines [on/off].
Examples
tab1.setlines(b2:d6) +o
draws borders around the outside of the rectangle defined by B2 and D6. Note that this command is equivalent to:
tab1.setlines(b2:d6) +a -h -v
which adds borders to all of the cells in the rectangle defined by B2 and D6, then removes the inner horizontal and vertical borders.
tab1.setlines(2,b) +o
puts a border around all four sides of the B2 cell.
tab1.setlines(2,b) -l -r +i
then removes both the left and the right border from the cell. In this example, “+i” option has no effect; since the specification involves a single cell, there are no inner borders.
tab1.setlines(@all) -a
removes all borders from the table.
Cross-references
See Table::settextcolor, Table::setfillcolor, and Table::setfont for details on changing text color and font.
For additional discussion of table commands see “Working with Tables and Spreadsheets”.
See also “Table Objects” for a discussion and examples of table formatting in EViews.
setmerge
Merges/unmerges one or more table cells.
Syntax
table_name.setmerge(cell_range)
where cell_range describes the table cells (in a single row) to be merged. The cell_range specifications are given by:
first_cell[:]last_cell, first_cell[,]last_cell
Left (right) cell of the selection range (specified in “cell” format), followed by right (left) cell of the selection range (specified in “cell” format), separated by a “:” or “,” (e.g., “A2:C2”, “A2,C2”, or “R2C1:R2C3”, “R2C1,R2C3”). Merge all cells in the region defined by the first column and last column for the specified row.
cell_row[,] first_cell_col[,] cell_row[,] last_cell_col
Left (right) cell of the selection range (specified in “row[,] col” format), followed by right (left) cell of the selection range (specified in “row[,] col” format, with a fixed row), separated by a “,” (e.g., “2,A,2,C” or “2,1,2,3”). Merge all cells in the row defined by the first column and last column identifier.
If the first specified column is less than the last specified column (left specified before right), the cells in the row will be merged left to right, otherwise, the cells will be merged from right to left.The contents of the merged cell will be taken from the first non-empty cell in the merged region. If merging from left to right, the left-most cell contents will be used; if merging from right to left, the right-most cell contents will be displayed.
If you specify a merge involving previously merged cells, EViews will unmerge all cells within the specified range.
Examples
tab1.setmerge(a2:d2)
tab1.setmerge(2,1,2,4)
merges the cells in row 2, columns 1 to 4, from left to right.
tab2.setmerge(r2c5:r2c2)
merges the cells in row 2, columns 2 to 5, from right to left. We may then unmerge cells by issuing the command using any of the previously merged cells:
tab2.setmerge(r2c4:r2c4)
unmerges the previously merged cells.
Note that in all cases, the setmerge command must be specified using cells in a single row. The command:
tab3.setmerge(r2c1:r3c5)
generates an error since the cell specification involves rows 2 and 3.
Cross-references
See Table::setwidth, Table::setheight and Table::setjust for details on setting table widths, height, and justification.
For additional discussion of table commands see “Working with Tables and Spreadsheets”.
See also “Table Objects” for a discussion and examples of table formatting in EViews.
setprefix
Set the cell prefix string for the specified table cells.
Syntax
table_name.setprefix(cell_range) prefix
where prefix is the prefix you wish to assign to the cells. To remove a prefix from a cell, leave prefix empty.
The cell_range defines the cells to be modified. See Table::setformat for the syntax for cell_range specifications.
Examples
tab1.setprefix(A1) $
prepends the dollar sign ($) to the cell A1.
tab1.setprefix(A1)
removes the prefix from cell A1.
Cross-references
See Table::setwidth, Table::setindent and Table::setjust for details on setting table widths, indentation and justification.
For additional discussion of table commands see “Working with Tables and Spreadsheets”.
See also “Table and Text Objects” for a discussion and examples of table formatting in EViews.
setsuffix
Set the cell suffix string for the specified table cells.
Syntax
table_name.setsuffix(cell_range) suffix
where suffix is the suffix you wish to assign to the cells. To remove a suffix from a cell, leave suffix empty.
The cell_range defines the cells to be modified. See Table::setformat for the syntax for cell_range specifications.
Examples
tab1.setsuffix(A1) $
appends the dollar sign ($) to the cell A1.
tab1.setsuffix(A1)
removes the suffix from cell A1.
Cross-references
See Table::setwidth, Table::setindent and Table::setjust for details on setting table widths, indentation and justification.
For additional discussion of table commands see “Working with Tables and Spreadsheets”.
See also “Table and Text Objects” for a discussion and examples of table formatting in EViews.
settextcolor
Changes the text color of the specified table cells.
Syntax
table_name.settextcolor(cell_range) color_arg
where cell_range describes the table cells to be modified, and color_arg specifies the color to be applied to the text in the cells. See Table::setfillcolor for the syntax for cell_range and color_arg.
Examples
To set an orange text color for the cell in the second row and sixth column of TAB1, you may use:
tab1.settextcolor(f2) @rgb(255, 128, 0)
tab1.settextcolor(2,f) @HEX(ff8000)
tab1.settextcolor(2,6) orange
tab1.settextcolor(r2c6) orange
You may also specify a blue color for the text in an entire column, or an entire row,
tab1.settextcolor(C) @RGB(0, 0, 255)
tab1.settextcolor(2) blue
or a green color for the text in cells in a rectangular region:
tab1.settextcolor(R2C3:R3C6) green
tab1.settextcolor(r2c3,r3c6) green
tab1.settextcolor(2,C,3,F) @rgb(0, 255, 0)
tab1.settextcolor(2,3,3,6) @HEX(00ff00)
You may also conditionally set the text color for a range of cells. For example, cell d3 will be set to red if cell b4 plus c4 is greater than cell d4 minus e4, and similarly for cells d4 to d18.
tab1.settextcolor(d3:d18 if [b4:b19]+[c4:c19] > [d4:d19]-[e4:e19]) red
This also works for fixed columns and rows. To set the text color for the cells a13 to b18 to red if the matching cells from the fixed column B (cells b4 to b9) are greater than 0.5:
tab1.settextcolor(a13:b18 if [b4:b9] > .5) red
This sets the text color for the cells e13 to f18 to orange if the matching cells from fixed row 4 (cells b4 to c4) are greater than 0.5. Specifically, the text color of cells e13 through e18 will be orange if cell b4 is greater than 0.5, and the text color of cells f13 through f18 will be orange if cell c4 is greater than 0.5:
tab1.settextcolor(e13:f18 if [b4:c4] > .5) orange
Cross-references
See Table::setfont and Table::setfillcolor for details on changing the text font and cell background color.
For additional discussion of table commands see “Working with Tables and Spreadsheets”.
See also “Table and Text Objects” for a discussion and examples of table formatting in EViews.
setwidth
Set the column width for selected columns in a table.
Syntax
table_name.setwidth(col_range) width_arg
where col_range is either a single column number or letter (e.g., “5”, “E”), a colon delimited range of columns (from low to high, e.g., “3:5”, “C:E”), or the keyword “@ALL”, and width_arg specifies the width unit value. The width unit is computed from representative characters in the default font for the current table (the EViews table default font at the time the table was created), and corresponds roughly to a single character. width_arg values may be non-integer values with resolution up to 1/10 of a width unit.
Examples
tab1.setwidth(2) 12
sets the width of column 2 to 12 width units.
tab1.setwidth(2:10) 20
sets the widths for columns 2 through 10 to 20 width units.
You many conditionally set the column width. This will set the individual column widths of columns c through e to 5 if the cells in column b are greater than 0.5. Specifically, the width of column c will be set to 5 if cell b20 is greater than 0.5:
tab1.setwidth(c:e if [b20:d20] > .5) 5
Cross-references
See Table::setheight, Table::setindent and Table::setjust for details on setting table height, indentation and justification.
For additional discussion of table commands see “Working with Tables and Spreadsheets”.
See also “Table and Text Objects” for a discussion and examples of table formatting in EViews.
sheet
Display a table object.
Syntax
table_name.sheet(options)
Options
p
Print the spreadsheet view.
Examples
tab1.sheet(p)
displays and prints table TAB1.
sort
Sort the selected rows of a table object.
Syntax
table_name.sort(cell_range) column_arg
where column_arg is a list of columns by which to sort the cell_range. You may specify up to three columns for sorting. The specified columns must be within the cell_range. If you list two or more columns, sort uses the values of the second column to resolve ties in the first column, and values of the third column to resolve ties in the first and second. By default, EViews will sort in ascending order. To sort in descending order, precede the column name with a minus sign (“-”).
The cell_range defines the cells to be modified. See Table::setformat for the syntax for cell_range specifications.
Examples
tab1.sort(a1:c20) b
sorts the cells from the 1st column 1st row to the 3rd column 20th row by column b in ascending order.
tab1.sort(b10:z250) –f h q
sorts the cells from the 2nd column 10th row to the 26th column 250th row by column f in descending order, then in ascending order by column h and once again in ascending order by column q.
Cross-references
See Table::setformat for the syntax for cell_range specifications.
table
Declare a table object.
The table command declares and optionally sizes a table object. When used as a table view, table displays the contents of the table.
Syntax
table(rows, cols) table_name
table_name.table(options)
The table command takes two optional arguments specifying the row and column dimension of the table, and is followed by the name you wish to give the matrix. If no sizing information is provided, the table will contain a single cell.
You may also include an assignment in the sym command. The symmetric matrix will be resized, if necessary. Once declared, symmetric matrices may be resized by repeating the sym command with new dimensions.
The table view displays the contents of the table. It is a synonym for sheet.
Examples
table onelement
declares a one element table
table(10,5) outtable
creates a table OUTTABLE with 10 rows and 5 columns.
Cross-references
See also freeze and Table::sheet.
For additional discussion of table commands see “Working with Tables and Spreadsheets”.
See “Table and Text Objects” for a general discussion and examples of table formatting in EViews.
title
Assign or change the title of a table.
Syntax
table_name.title title_arg
where title_arg is a case sensitive string which may contain spaces.
Examples
tab1.title Estimated Models
sets the TAB1 title to “Estimated Models.”
tab1.title
clears the TAB1 title.
Cross-references
See also Table::displayname and Table::label.
transpose
Transposes a set of cells in the table.
Syntax
table_name.transpose(cell_range)
where cell_range can take one of the following forms:
@all
Apply to all cells in the table.
cell
Cell identifier. You can identify cells using either the column letter and row number (e.g., “A1”), or by using “R” followed by the row number, followed by “C” and the column number (e.g., “R1C2”).
row[,] col
Row number, followed by column letter or number, separated by “,” (e.g., “2,C”, or “2,3”). Apply to cell.
row
Row number (e.g., “2”). Apply to all cells in the row.
col
Column letter (e.g., “B”). Apply to all cells in the column.
first_cell[:]last_cell,
first_cell[,]last_cell
Top left cell of the selection range (specified in “cell” format), followed by bottom right cell of the selection range (specified in “cell” format), separated by a “:” or “,” (e.g., “A2:C10”, “A2,C10”, or “R2C1:R10C3”, “R2C1,R10C3”). Apply to all cells in the rectangular region defined by the first cell and last cell.
first_cell_row[,] first_cell_col[,]
last_cell_row[,] last_cell_col
Top left cell of the selection range (specified in “row[,] col” format), followed by bottom right cell of the selection range (specified in “row[,] col” format), separated by a “,” (e.g., “2,A,10,C” or “2,1,10,3”). Apply to all cells in the rectangular region defined by the first cell and last cell.
Examples
To rotate the cells in column 1 to row 1 in table TAB1:
tab1.transpose(A)
To rotate all of the cells in TAB1:
tab1.transpose(@all)
To rotate the cells in range B11:C20 to range B11:K12:
tab1.transpose(b11:c20)