another meaning of the caret operator ^?

load path = ^dpath;

load temp[]= ^sfile; nseries=rows(temp)/2;

The above is part of a code file. I don't understand the meaning of ^ and errors come out when I type the statement on command window.

Tags: asked September 10, 2013

1 Answer


The GAUSS load command takes a literal file name, for example:

load temp[] = C:\gauss13\myproject\mydata.csv;

will attempt to load the data from the file mydata.csv in the directory C:\gauss13\myproject. If you want to pass the contents of a string variable to the load command, then you need to add the caret operator (^) in front of the variable name like this:

mydatafile = "C:\\gauss13\\myproject\\mydata.csv";
load temp[] = ^mydatafile;

This second code snippet is equivalent to the first code snippet. If that path or file does not exist on your computer, then GAUSS will return errors.