library("broadcast")
x <- array(sample(month.abb), c(10, 2))
y <- array(sample(1:10), c(10, 2, 3))
print(x)
#> [,1] [,2]
#> [1,] "Nov" "May"
#> [2,] "Jun" "Apr"
#> [3,] "Mar" "Nov"
#> [4,] "Feb" "Jun"
#> [5,] "Oct" "Mar"
#> [6,] "Sep" "Feb"
#> [7,] "Jan" "Oct"
#> [8,] "Dec" "Sep"
#> [9,] "Aug" "Jan"
#> [10,] "Jul" "Dec"
print(y)
#> , , 1
#>
#> [,1] [,2]
#> [1,] 1 1
#> [2,] 2 2
#> [3,] 4 4
#> [4,] 3 3
#> [5,] 7 7
#> [6,] 10 10
#> [7,] 5 5
#> [8,] 9 9
#> [9,] 8 8
#> [10,] 6 6
#>
#> , , 2
#>
#> [,1] [,2]
#> [1,] 1 1
#> [2,] 2 2
#> [3,] 4 4
#> [4,] 3 3
#> [5,] 7 7
#> [6,] 10 10
#> [7,] 5 5
#> [8,] 9 9
#> [9,] 8 8
#> [10,] 6 6
#>
#> , , 3
#>
#> [,1] [,2]
#> [1,] 1 1
#> [2,] 2 2
#> [3,] 4 4
#> [4,] 3 3
#> [5,] 7 7
#> [6,] 10 10
#> [7,] 5 5
#> [8,] 9 9
#> [9,] 8 8
#> [10,] 6 6
bc_strrep(x, y)
#> , , 1
#>
#> [,1] [,2]
#> [1,] "Nov" "May"
#> [2,] "JunJun" "AprApr"
#> [3,] "MarMarMarMar" "NovNovNovNov"
#> [4,] "FebFebFeb" "JunJunJun"
#> [5,] "OctOctOctOctOctOctOct" "MarMarMarMarMarMarMar"
#> [6,] "SepSepSepSepSepSepSepSepSepSep" "FebFebFebFebFebFebFebFebFebFeb"
#> [7,] "JanJanJanJanJan" "OctOctOctOctOct"
#> [8,] "DecDecDecDecDecDecDecDecDec" "SepSepSepSepSepSepSepSepSep"
#> [9,] "AugAugAugAugAugAugAugAug" "JanJanJanJanJanJanJanJan"
#> [10,] "JulJulJulJulJulJul" "DecDecDecDecDecDec"
#>
#> , , 2
#>
#> [,1] [,2]
#> [1,] "Nov" "May"
#> [2,] "JunJun" "AprApr"
#> [3,] "MarMarMarMar" "NovNovNovNov"
#> [4,] "FebFebFeb" "JunJunJun"
#> [5,] "OctOctOctOctOctOctOct" "MarMarMarMarMarMarMar"
#> [6,] "SepSepSepSepSepSepSepSepSepSep" "FebFebFebFebFebFebFebFebFebFeb"
#> [7,] "JanJanJanJanJan" "OctOctOctOctOct"
#> [8,] "DecDecDecDecDecDecDecDecDec" "SepSepSepSepSepSepSepSepSep"
#> [9,] "AugAugAugAugAugAugAugAug" "JanJanJanJanJanJanJanJan"
#> [10,] "JulJulJulJulJulJul" "DecDecDecDecDecDec"
#>
#> , , 3
#>
#> [,1] [,2]
#> [1,] "Nov" "May"
#> [2,] "JunJun" "AprApr"
#> [3,] "MarMarMarMar" "NovNovNovNov"
#> [4,] "FebFebFeb" "JunJunJun"
#> [5,] "OctOctOctOctOctOctOct" "MarMarMarMarMarMarMar"
#> [6,] "SepSepSepSepSepSepSepSepSepSep" "FebFebFebFebFebFebFebFebFebFeb"
#> [7,] "JanJanJanJanJan" "OctOctOctOctOct"
#> [8,] "DecDecDecDecDecDecDecDecDec" "SepSepSepSepSepSepSepSepSep"
#> [9,] "AugAugAugAugAugAugAugAug" "JanJanJanJanJanJanJanJan"
#> [10,] "JulJulJulJulJulJul" "DecDecDecDecDecDec"bc_strrep
Broadcasted strrep
Description
The bc_strrep() method is a broadcasted form of strrep.
Usage
bc_strrep(x, y, ...)
## S4 method for signature 'ANY'
bc_strrep(x, y)
Arguments
x
|
vector/array of type character.
|
y
|
vector/array of type integer.
|
β¦
|
further arguments passed to or from methods. |
Value
A character array as a result of the broadcasted repetition operation.