data_create


See also: data_custom, data_excel

Spreadsheet editors are today the standard part of software tools for data processing. Spreadsheet forms simple and efficient interface for data preparation. Therefore, spreadsheet editor was added to the Stagraph toolbox.

The data_create function is accessible without restrictions also in the Free version. Its advantage is that if you save your project with a dataset created through this function, data will be stored in the project file. However, this approach is not appropriate if you want to use large datasets. In this case, the better approach is to separate project and source data.

Built-in spreadsheet you can display by pressing the Create button in the ribbon toolbar.

The spreadsheet appears as a separate window in the Document Area. The window consist of two parts - a toolbar and spreadsheet.

You will find nine buttons in the toolbar. Their functionality is shown in the following figure. Using these buttons, you can import data into a spreadsheet, export them as a CSV or Excel file, clear spreadsheet, create a new dataset in current project, define the number of rows and columns in spreadsheet.

If you have the data in spreadsheet ready, you can import it as a dataset to the project. The data can be defined together with variable names (columns) or without them.

If you want to import data from spreadsheet, select them by the mouse. Then click on the Create Dataset button in the toolbar.

A help dialog will be displayed. In this dialog you can setup import properties. In the first text-box you type the Dataset Name. This name must be unique (in the current project). Use the Include Header check-box to define whether your selected data contains variable names (columns) in the first row.

The following table lists all selected variables, together with predicted data types. This dialog allows you to change the data type. If you click on the selected row, its content appears below the table, where you can modify the data type. Overall, this dialog presents only a simple interface that allows you to choose from three data types - text, number and date-time. More types can be defined later using the Data Wrangling functions.

Finally, using the String As Factor check-box, you can set whether text variables will be imported as character or factor variables. If you have defined individual settings, press the Apply button and new dataset will be executed in the background-running R Runtime. After the successful execution, your dataset will be listed in the Project Panel.

If the Data Preview Document is displayed, the result will also be presented in this interface.

If you double-click on the dataset in Project Panel, its definition will appear in the Properties Panel. Clicking on the data_create function you can show its definition, in the form of simple R script. This script you can later modify according to your needs.

This R script is written in a very simple form - it is also understandable for people without programming experience in R language. However, the script is not effectively editable in the Panel. If you want to edit the script in a text-box that supports syntax highlighting and code autocompletion, press the F11 Key. Text Extender dialog appears.

In this window, you can edit the script more comfortably and quickly. When you finish you edits, you can insert your changes back to the Properties Panel, again by pressing the F11 key. If you click on the Close button, your changes will not be applied. Prepared dataset you can use immediately.

Text Extender dialog is accessible from all text-boxes that are displayed in the Properties Panel. If you have your cursor focused in any text-box, just press the F11 key.