library("iemisc")
import::from(pracma, ones)
# Example from pracma isempty
object1 <- matrix(0, 1, 0)
length_octave(object1)
object2 <- 2
length_octave(object2)
object3 <- 1:10
length_octave(object3)
object4 <- ones(3, 4)
length_octave(object4)
object5 <- "ss"
length_octave(object5)
object6 <- list(letters, b <- 2)
length_octave(object6)
if (FALSE) {
# check against GNU Octave
library(RcppOctave) # requires Octave (>= 3.2.4) and its development files
o_source(text = "
object1 = [];
length(object1)
object2 = 2;
length(object2)
object3 = 1:10;
length(object3)
object4 = ones(3, 4);
length(object4)
object5 = 'ss';
length(object5)
")
}
Run the code above in your browser using DataLab