Hi, I am new to R and I came across an issue I can't deal with.
I am generating knight tour plots based on the following matrix
Mat = matrix(c(DATA), nrow=SIZE, ncol=SIZE, byrow=T)
instead of SIZE I put 300 and instead of DATA I put 90 000 numbers seperated by commas.
However when I try to run it in the console it stops on some number within the matrix and does not finish, leaving me unable to use console as no new line with ">" appears, I can write in it but it does nothing. This issue with console is present even after restaring the Rstudio.
It worked correctly when I tried to make a 100 x 100 matrix. Is there something I don't know about creating matrix ?
Sorry if I gave too little information, I can provide more if specified
My first thought is some kind of memory problem but a quick test
xx <- sample(0:9, 90000, replace = TRUE)
mat <- matrix(xx, nrow = 300, ncol = 300, byrow = TRUE)
seems fine on my lap-top.
Still, what happens if you try with n = 10 000?
BTW I think you only need to specify ncol or nrow.
Your test code works fine for me as well, with 10 000 numbers the matrix is created properly and can be used, however this test gave me smth to think about, will let know soon, thx
The console has a line length limit.
Where are you getting the numbers from to paste in? If a file you should tell R to read from the file. Its copy and pasting long strings to console that is foiling you.