getname#
Purpose#
Returns a column vector containing the names of the variables in a GAUSS dataset.
Format#
- var_names = getname(dset)#
- Parameters:
dset (string) – the name of the dataset from which the function will obtain the variable names
- Returns:
var_names (Nx1 vector) – contains the names of all of the variables in the specified dataset.
Examples#
/*
** Get the variable names from
** the file `freqdata` stored in the GAUSS
** examples directory
*/
var_names = getname(getGAUSSHome() $+ "examples/freqdata.dat");
// Print format
format 8,8;
// Print variable names
print $var_names;
produces:
AGE
PAY
sex
WT
Remarks#
The output, var_names, will have as many rows as there are variables in the dataset.
See also
Functions getnamef()
, indcv()