Data types#

Dataframes#

General#

asdf

Converts a matrix or string array to a dataframe, and optionally sets the column names.

asMatrix

Converts a dataframe to a matrix.

dfappend

Vertically conacatenates (or stacks) two dataframes.

dfname

Sets the variable names of the columns of a dataframe.

dftype

Sets the types (numeric, categorical, date or string) of a dataframe.

getcolnames

Returns the names of the columns (or variables) in a GAUSS dataframe.

getColTypes

Returns the types for the columns (or variables) in a GAUSS dataframe.

hasMetaData

Checks to see if a symbol is a dataframe.

setcolmetadata

Sets the variable names and types for the columns of a dataframe.

setcolnames

Sets the variable names the columns of a dataframe.

Date variables#

asDate

Converts vectors in Posix time or string dates to a GAUSS date variable and optionally sets the date display format.

dtDayName

Extracts the day from a date/time variable as a string name.

dtDayofMonth

Extracts the day of the month from a date/time variable as a decimal number (1-31).

dtDayofWeek

Extracts the day of the week from a date/time variable as a decimal number.

dtDayofYear

Extracts the day of the year from a date/time variable as a decimal number (1-366).

dtHour

Extracts the hour from a date/time variable as a number (1-12 or 1-24).

dtMinute

Extracts the minute from a date/time variable as a number (0-59).

dtMonth

Extracts the month from a date/time variable as a decimal number(1-12).

dtMonthName

Extracts the month from a date/time variable as a string name.

dtQuarter

Extracts the quarter from a date/time variable (1-4).

dtSecond

Extracts the seconds from a date/time variable as a number (0-59).

dtWeek

Extracts the week from a date/time variable as a number (0-53).

dtYear

Extracts the year from a date/time variable as a number.

getColDateFormats

Gets BSD strftime format specifiers for specified columns of a dataframe.

setColDateFormats

Specifies how GAUSS should display dates using the BSD strftime format specifiers. Note that this will also convert the type of the columns specified by column to Date.

String and categorical variables#

dropCategories

Removes categories from the variable and the meta data. Resets the keyvalues and labels for the variable.

dropUnusedCategories

Removes categories from the meta data of a dataframe that are not present in the current variable.

getCategories

Returns the unique set of column labels as a dataframe.

getcollabels

Returns the unique set of column labels and corresponding key values for a categorical variable.

recodeCatLabels

Change categorical variable labels.

reorderCatLabels

Change the order of categorical variable labels.

setBaseCat

Sets a category in a categorical variable to be the base case.

setBaseCat

Sets a category in a categorical variable to be the base case.

startsWith

Returns a 1 if a string starts with a specified pattern.

Matrices#

Matrix creation#

eye

Creates identity matrix.

matalloc

Allocates a matrix with unspecified contents.

matinit

Allocates a matrix with specified fill value.

ones

Creates a matrix of ones.

zeros

Creates a matrix of zeros.

Size and range#

cols

Returns number of columns in a matrix.

colsf

Returns number of columns in an open data set.

maxc

Returns largest element in each column of a matrix.

minc

Returns smallest element in each column of a matrix.

rows

Returns number of rows in a matrix.

rowsf

Returns number of rows in an open data set.

Other#

diag

Extracts the diagonal of a matrix.

diagrv

Puts a column vector into the diagonal of a matrix.

lowmat, lowmat1

Returns the lower triangle of a matrix with the main diagonal or a diagonal of ones.

upmat, upmat1

Returns the upper triangle of a matrix with the main diagonal or a diagonal of ones.

Complex numbers#

complex

Creates a complex matrix from two real matrices.

hasimag

Tests whether the imaginary part of a complex matrix is negligible.

imag

Returns the imaginary part of a complex matrix.

iscplx

Tests whether a matrix is complex.

real

Returns the real part of a complex matrix.

N-Dimensional arrays#

Array creation#

aconcat

Concatenates conformable matrices and arrays in a user-specified dimension.

aeye

Creates an N-dimensional array in which the planes described by the two trailing dimensions of the array are equal to the identity.

areshape

Reshapes a scalar, matrix, or array into an array of user-specified size.

arrayalloc

Creates an N-dimensional array with unspecified contents.

arrayinit

Creates an N-dimensional array with a specified fill value.

mattoarray

Converts a matrix to a type array.

squeeze

Remove any singleton dimensions from a multi-dimensional array.

Size and range#

amax

Moves across one dimension of an N-dimensional array and finds the largest element.

amin

Moves across one dimension of an N-dimensional array and finds the smallest element.

getdims

Gets the number of dimensions in an array.

getorders

Gets the vector of orders corresponding to an array.

Selection and indexing#

arrayindex

Converts a scalar vector index to a vector of indices for an N-dimensional array.

getarray

Gets a contiguous subarray from an N-dimensional array.

getmatrix

Gets a contiguous matrix from an N-dimensional array.

getmatrix4D

Gets a contiguous matrix from a 4-dimensional array.

getscalar3D

Gets a scalar from a 3-dimensional array.

getscalar4D

Gets a scalar from a 4-dimensional array.

loopnextindex

Increments an index vector to the next logical index and jumps to the specified label if the index did not wrap to the beginning.

nextindex

Returns the index of the next element or subarray in an array.

previousindex

Returns the index of the previous element or subarray in an array.

singleindex

Converts a vector of indices for an N-dimensional array to a scalar vector index.

walkindex

Walks the index of an array forward or backward through a specified dimension.

Transform#

aconcat

Concatenates conformable matrices and arrays in a user-specified dimension.

areshape

Reshapes a scalar, matrix, or array into an array of user-specified size.

atranspose

Transposes an N-dimensional array.

arraytomat

Changes an array to type matrix.

putarray

Puts a contiguous subarray into an N-dimensional array and returns the resulting array.

Other#

amean

Computes the mean across one dimension of an N-dimensional array.

asum

Computes the sum across one dimension of an N-dimensional array.

astd

Computes the standard deviation of the elements across one dimension of an N-dimensional array.