Skip to content

Commands

Artur Tarassow edited this page May 25, 2023 · 3 revisions

Here you are going to find hansl commands.

The official command reference can be found here: https://gretl.sourceforge.net/gretl-help/cmdref.html

Store data

Use the store command which offers many options (https://gretl.sourceforge.net/gretl-help/cmdref.html#store).

Store a matrix as a csv file

Here is an example using a 5 by 3 matrix.

set verbose off
matrix m = mnormal(5, 3)
cnameset(m, defarray("A", "B", "C"))  # let's attach column labels
print m

store "foo.csv" --matrix=m
open "foo.csv" --quiet
print dataset -o

The output is:

m (5 x 3)

           A            B            C 
     -1.2903     0.093702      0.16285 
    -0.70623     -0.13663      0.70518 
     0.10001     -0.54411     -0.59623 
     -1.3243      -1.0267       2.0040 
     0.59176     -0.77972     -0.46372 

wrote foo.csv

             A            B            C

1    -1.290321     0.093702     0.162854
2    -0.706230    -0.136629     0.705183
3     0.100014    -0.544113    -0.596228
4    -1.324291    -1.026685     2.003978
5     0.591764    -0.779717    -0.463718
Clone this wiki locally