Create a script
- Fast way
- Advanced way
- Open Datagrok (e.g. public homepage)
- Select
Browse
icon on the left toolbar. - Select Datagrok's Scripts section.
- Click on the "New" button and create a new script in your preferred language.
- Enable extended Main menu in the Window icon on the right toolbar
- Open Main menu > Tools > Scripting.
- Choose the language for the script
Default scripts for different languages:
- Python
- R
- JavaScript
#name: Template
#description: Calculates the number of cells in the table
#language: python
#tags: template, demo
#sample: cars.csv
#input: dataframe table [Data table]
#output: int count [Number of cells in the table]
count = table.shape[0] * table.shape[1]
#name: Template
#description: Calculates the number of cells in the table
#language: r
#tags: template, demo
#sample: cars.csv
#input: dataframe table [Data table]
#output: int count [Number of cells in the table]
count <- nrow(table) * ncol(table)
//name: Template
//description: Hello world script
//language: javascript
alert('Hello World!');