0
votes

I have a huge matrix of approximately 39000 rows and almost 80 columns. In R I am getting an error which says:

Error in matrix(1, nrow = n, ncol = 1) : non-numeric matrix extent

When I did typeof(matrix) it gave me "double". Is there any way to find out what and where the problem is and any solution to the error?

1
Could you post a snippet of code showing how you assign your n and create your matrix? It looks like n isn't an integer, perhaps.mathematical.coffee
You're saying you have pain. We would like to know where it hurts and how it hurts.Roman Luštrik

1 Answers

4
votes

n in this call matrix(1, nrow = n, ncol = 1) is not numeric. You can replicate this with:

> matrix(1, nrow = "foo", ncol = 1)
Error in matrix(1, nrow = "foo", ncol = 1) : non-numeric matrix extent

So now you need to show the code you used to generate that error.