Initializing help system before first use

# Rgetarr

Purpose
Get the resulting array of an R expression.
Synopsis
`procedure Rgetarr(cmd:string, arr:array)`
Arguments

cmd | Statements to evaluate
arr | Destination Mosel array

Example
The following example loads the R cars example dataset into the Mosel array cars:

     declarations
      cars:array(range, set of string) of integer
     end-declarations
     Rgetarr('as.matrix(datasets::cars)',cars)

Further information
1. If cmd contains more than one statement, the returned value is the result of the last one.
2. The Mosel array arr must have the same number of dimensions as the R array; NA entries in R are skipped and corresponding entries in arr are left unchanged (note that arr is not cleared before loading R data).
3. Supported index types for the arr array are string and integer. In the case of strings, the R array must have a valid names or dimnames attribute for the corresponding dimension; in the case of integers, the R integer indices (1 to n) are used. All entries of the R array are converted to the same type as the destination array within R.
Related topics
Rgetarr, Rgetint, Rgetreal, Rgetstr
Parent Topic Procedures and functions

© 2001-2026 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.