matrix - quickest way in R to check that all columns are identical -


Assume that I have a matrix with 3 columns

  10 10 10 8 8 8 9 9 7 7 7 5 5 4 4 3 3 3 6 6 6 2 2 2 1 1 1   

What would be the fastest way to check that all the columns are the same? I can do something like all or identical to check any two and then keep on moving with the next set, but is there anything more clever?

Ideally, I would like a solution that is independent of the number of columns.

You can try: data

  m1 < - Matrix (c (10: 1, 10: 1, 10: 1), nucleus = 3) M2 and lieutenant - cbind (m1, 11: 2)    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -