Integerize array elements
force.integer.Rd
Returns an elementwise as.integer
-ed array. All magic squares
should have integer elements.
Note
Function force.integer()
differs from as.integer()
as
the latter returns an integer vector, and the former returns an array
whose elements are integer versions of x
; see examples section
below.
Examples
a <- matrix(rep(1,4),2,2)
force.integer(a)
#> [,1] [,2]
#> [1,] 1 1
#> [2,] 1 1
as.integer(a)
#> [1] 1 1 1 1