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.
_______________________________________________
datatable-help mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help

Reply via email to