r - How to round all values in a matrix? -


I use the following method to store all my relationships in the matrix:
 

Code> corrs & lt; - cor (use dataset = "pairwise.complete.obs")

But now I want to round the values ​​in two digits after a comma. How can I do that? I just got a round function, but it does not know how to implement all the values.

Just as in your second question, the function ( rounds ) Use :)

  corrs & lt; - Round (Core (Dataset, Usage = "pairwise.complete.obs"), 2)   

For example:

  & gt; Goal (Core (car), 2) Speed ​​speed 1.00 0.81 d 0.81 1.00    

Comments