Reference Guide > R Routines > REPLICATE Function
  

REPLICATE Function
Forms an array with the given dimensions, filled with the specified scalar value.
enabled.
Usage
result = REPLICATE(value, dim1, ... , dimn)
Input Parameters
value—The scalar value used for filling the resulting array. May be of any scalar type, including scalar structures.
dimiThe dimensions of the result.
Returned Value
result—An array with the given dimensions, filled with the specified value. The resulting data type is that of value.
Keywords
None.
Example
This example uses REPLICATE to create a 4-by-3 string array. Each element of the array contains the string “string”.
strs = REPLICATE('string', 4, 3)
INFO, strs
; PV-WAVE prints: STRS        STRING         = Array(4, 3)
PRINT, strs
; PV-WAVE prints the following: 
; string    string    string    string
; string    string    string    string
; string    string    string    string
See Also
MAKE_ARRAY, REPLV, alibRep

Version 2017.0
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.