## Create a random array, matrix, vector
set.seed(307)
a <- array(runif(24), dim = c(2, 3, 4))
a[4:8] <- 4:8
m <- matrix(runif(12), 3, 4)
m[2:4] <- 2:4
v <- complex(real = seq(0.5, 1.5, by = 0.1),
imaginary = seq(2.5, 3.5, by = 0.1))
## Find whole entries
is.whole(a)
is.whole(m)
is.whole(v)
## Numbers of class integer are always whole
is.whole(dim(a))
is.whole(length(v))
Run the code above in your browser using DataLab