Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

force.integer

Integerize array elements


Description

Returns an elementwise as.integer-ed array. All magic squares should have integer elements.

Usage

force.integer(x)

Arguments

x

Array to be converted

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.

Author(s)

Robin K. S. Hankin

Examples

a <- matrix(rep(1,4),2,2)
force.integer(a)
as.integer(a)

magic

Create and Investigate Magic Squares

v1.5-9
GPL-2
Authors
Robin K. S. Hankin
Initial release
2018-09-14

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.