[datatable-help] craeating vectors

rlue rluech at gmail.com
Mon Jun 5 17:24:38 CEST 2017


mx <- matrix(rep(rep(0L, 1000), 100), ncol = 100)
index <- c(0, 500)
for(i in seq(ncol(mx))) mx[index+i, i] <- 1

# check
mx[c(1:5, 500:505), 1:10]

# check
apply(mx, 2, function(x) which(x == 1))




--
View this message in context: http://r.789695.n4.nabble.com/craeating-vectors-tp4736241p4736374.html
Sent from the datatable-help mailing list archive at Nabble.com.


More information about the datatable-help mailing list