## Format¶

load [[path=path]]x, y[ ]=filename, z = filename;


## Remarks¶

All the loadxx commands use the same syntax, they only differ in the types of symbols you use them for:

 load, loadm matrix loads string loadf function (fn) loadk keyword (keyword) loadp procedure (proc)

If no filename is given, as with x above, then the symbol name the file is to be loaded into is used as the filename, and the proper extension is added.

If more than one item is to be loaded in a single statement, the names should be separated by commas.

The filename can be either a literal or a string. If the filename is in a string variable, then the ^ (caret) operator must precede the name of the string, as in:

filestr = "mydata/char";


If no extension is supplied, the proper extension for each type of file will be used automatically as follows:

 load .fmt - matrix file or delimited ASCII file loadm .fmt - matrix file or delimited ASCII file loads .fst - string file loadf .fcg - user-defined function (fn) file loadk .fcg - user-defined keyword (keyword) file loadp .fcg - user-defined procedure (proc) file

These commands also signal to the compiler what type of object the symbol is so that later references to it will be compiled correctly.

A dummy definition must exist in the program for each symbol that is loaded in using loadf, loadk, or loadp. This resolves the need to have the symbol initialized at compile time. When the load executes, the dummy definition will be replaced with the saved definition:

proc corrmat;
endp;

y = corrmat;

keyword regress(x); endp;
regress x on y z t from data01;

fn sqrd=;
y = sqrd(4.5);


To load GAUSS files created with the save command, no brackets are used with the symbol name.

If you use save to save a scalar error code 65535 (i.e., error(65535)), it will be interpreted as an empty matrix when you load it again.

### ASCII data files¶

Note

This function is a deprecated function. Consider using csvReadM() instead.

To load ASCII data files, square brackets follow the name of the symbol.

Numbers in ASCII files must be delimited with spaces, commas, tabs, or newlines. If the size of the matrix to be loaded is not explicitly given, as in:

load x[] = data.asc;


GAUSS will load as many elements as possible from the file and create an Nx1 matrix. This is the preferred method of loading ASCII data from a file, especially when you want to verify if the load was successful. Your program can then see how many elements were actually loaded by testing the matrix with the rows command, and if that is correct, the Nx1 matrix can be reshape’d to the desired form. You could, for instance, put the number of rows and columns of the matrix right in the file as the first and second elements and reshape the remainder of the vector to the desired form using those values.

If the size of the matrix is explicitly given in the load command, then no checking will be done. If you use:

load x[500,6] = data.asc;


GAUSS will still load as many elements as possible from the file into an Nx1 matrix and then automatically reshape it using the dimensions given.

If you load data from a file, data.asc, which contains nine numbers (1 2 3 4 5 6 7 8 9), then the resulting matrix will be as follows:

load x[1,9] = data.asc;

x = 1 2 3 4 5 6 7 8 9

load x[3,3] = data.asc;

    1 2 3
x = 4 5 6
7 8 9

load x[2,2] = data.asc;

x = 1 2
3 4

load x[2,9] = data.asc;

x = 1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9

load x[3,5] = data.asc;

    1 2 3 4 5
x = 6 7 8 9 1
2 3 4 5 6


load accepts pathnames. The following is legal:

loadm k = /gauss/x;


This will load /gauss/x.fmt into k.

If the path= subcommand is used with load and save, the path string will be remembered until changed in a subsequent command. This path will be used whenever none is specified. There are four separate paths for:

#. load, loadm #. loadf, loadp #. loads #. save

Setting any of the four paths will not affect the others. The current path settings can be obtained (and changed) with the sysstate() function, cases 4-7.

loadm path = /data;


This will change the loadm path without loading anything.

load path = /gauss x,y,z;


This will load x.fmt, y.fmt, and z.fmt using /gauss as a path. This path will be used for the next load if none is specified.

The load path or save path can be overridden in any particular load or save by putting an explicit path on the filename given to load from or save to as follows:

loadm path = /miscdata;
loadm x = /data/mydata1, y, z = hisdata;


In the above program:

/data/mydata1.fmt would be loaded into a matrix called x.

/miscdata/y.fmt would be loaded into a matrix called y.

/miscdata/hisdata.fmt would be loaded into a matrix called z.

oldmpath = sysstate(5,"/data");

This will get the old loadm path, set it to /data, load x.fmt and y.fmt, and reset the loadm path to its original setting.
{"ft_lang_label":"__label__en","ft_lang_prob":0.8291511,"math_prob":0.7128658,"size":4800,"snap":"2023-40-2023-50","text_gpt3_token_len":1360,"char_repetition_ratio":0.12823185,"word_repetition_ratio":0.08940397,"special_character_ratio":0.2725,"punctuation_ratio":0.14873713,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9666022,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-10-01T22:37:42Z\",\"WARC-Record-ID\":\"<urn:uuid:04025596-ec1b-499b-bfa8-df0f415fb8a8>\",\"Content-Length\":\"182099\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:f3308c1a-9a14-4c39-adfe-c89918774825>\",\"WARC-Concurrent-To\":\"<urn:uuid:6d9d6b67-3c9c-465d-980d-9797948d6d52>\",\"WARC-IP-Address\":\"104.21.89.175\",\"WARC-Target-URI\":\"https://docs.aptech.com/gauss/loadloadfloadkloadmloadploads.html\",\"WARC-Payload-Digest\":\"sha1:CBUOUNPWJ57CAO3YHO4FVBECVGWTOII7\",\"WARC-Block-Digest\":\"sha1:J2WHGKFNH3XMEI5SB25MZOJIDXSCA6MY\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-40/CC-MAIN-2023-40_segments_1695233510941.58_warc_CC-MAIN-20231001205332-20231001235332-00778.warc.gz\"}"}