Std New Table

From LabRPS Documentation
Revision as of 19:57, 25 October 2024 by LabRPS (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Std New Table.svg Std New Table

Menu location
File → New Table
Phenomena
All
Default shortcut
Ctrl+T
Introduced in version
0.1
See also
Std New, Std New Matrix

Description

The Std New Table command creates new table.

Usage

  1. There are several ways to invoke the command:
    • Press the Std New Table.svg New Table button.
    • Select the File → Std New Table.svgNew Table option from the menu.
    • Use the keyboard shortcut: Ctrl+T.

Note

It creates a new (empty) table and adds it to the project. The empty table will have 30 rows and 2 columns. A LabRPS Table is similar in appearance to a spreadsheet, but it differs in some important ways. In a spreadsheet, operations are performed on cells or on a range of cells. The cell is the basic unit being operated on. Row and column groupings have no inherent significance. Any relationship between observations in a spreadsheet row or column is created by the user.

In contrast, Tables in LabRPS more closely mimic a flat-file database, in that each row is essentially a record with each cell in that row sharing a common row index number that groups those cells together. So, for instance, the row index number might identify an individual, and each cell in that row might contain a measurement on a different variable associated with that individual. Thus, there exists an underlying association among cells within a row, independent of any explicit association that might be conceived of by the user.

Likewise -- extending the database metaphor -- each cell in the table column contains a measurement on a single variable, creating an inherent relationship among cells within a column. This column of measurements on a single variable serves to define the LabRPS Table dataset.

Table.png

Columns

A table column can be considered as an equivalent of one-dimensional data array. Every column of the table has a set of editable predefined properties: name label, data type, data format, and a column flag. Each column properties can be changed by selecting the column and editing the property via the table control box (Table -> Show/Hide Controls).

Name

You can edit the displayed column name by clicking Text on the control box tab and entering a new name. A detailed comment on the column can also be entered if needed or leave it blank. Columns are named as numbers by default in order of their creation. Each column should have a unique name different from the name of any other columns.

Type

Each Column has a type associated with it namely: Number, Text, or Datetime. This can be changed by selecting the desired column and changing the type combo box from the control box type tab.

Table type.png

Format

Once the type is selected formatting of the type can be achieved using format option from the control box type tab. For eg number type can have a decimal, scientific(e), or auto-formatting. Datetime type can have predefined or custom formatting based on QDateTime Class format options.

Flag

Columns can be assigned the following flags: X, Y, Z, X-error, Y-error or can be simple columns without any special flag(None). The X columns are abscissae columns while the Y columns are ordinate columns used when creating a 2D plot from data. The Z columns are used for 3D plots. The X-error and Y-error columns can be used in order to add error bars to 2D plots.

Table flag.png

The line color in the column header also represents the flag X(green), Y(brown), Z(violet), X-error/y-error(red), none(grey).

Type/Format Lock

The assigned flag or type will be locked(depicted by the lock symbol along with the type icon) once you use the column for 2D or 3D plots. After locking, the user will not be allowed to change the type/format unless the plot associated with the column doesn't exist anymore.


Table type lock.png

Operations

You can select all the columns of the spreadsheet (Ctrl+A) or only some of them by clicking on the column label while keeping the Ctrl key pressed, or by moving the mouse over the column label. This also allows you to deselect columns.

On the selected columns you can perform various operations:

  • Fill with data. You can insert the row numbers (Fill Selection With→Row Numbers command), random numbers (Fill Selection With→Random Values command), custom random numbers(Fill Selection With→Custom Random Values command and select Gaussian, Laplace, Exponential distributions etc), or the result of a function (Assign Formula command);
  • normalize columns with the Normalize Columns command of the context menu;
  • sort columns with the Sort Table command of the Table menu or with the sort column command of the context menu;
  • compute statistical data on columns and rows with the Statistics on Columns command and Statistics on Rows command of the Analysis-tables menu;
  • build a plot from selected columns with the plot command of the context menu or with the commands of the Plot menu

All these functions can be reached by right-clicking when a column is selected. Most of them can also be reached by using the Table menu.

You can cut, copy and paste data between spreadsheets or between a spreadsheet and another application (Excel, Gnumeric, OpenOffice Calc, etc).

You can import single or multiple ASCII files using the Import Ascii command from the File menu. This will create one or more new tables. You can also export the data from the spreadsheet to a text file using the Export Ascii command.

Import ASCII

Imports one or more ASCII files (File -> Import Ascii) into the project by creating a new table storing the data from the file.

Import ascii.png

You can choose to put each data file in a separate table or join all the data files in one table. There is no automatic analysis of the data. Therefore, by default, the data will be read as text. If you want to obtain directly numeric values, you can specify it in the numeric data checkbox. You must then indicate the format of the numbers. The other possibility is to read data as text and then to specify the type and format of the different columns with the properties dialog of the tables.

If you check the Remember the above options, the selected parameters will be used as default values. They will be used if you read an ASCII file directly from the command line (see the Command line options section for more details).