9) Viewing a Matrix

This Blog entry is from the Data Structures section in Learn R.

It can be observed that the matrix created in previous Blog entries has been written out to the console.  It was noted that there is a new section titled data in the environment pane,  under which the matrix is displayed. 

To expand the data into a tabbed grid,  simply click with the mouse on the Matrix3Col under the data section of the environment pane:

1.png

The tabbed grid will explode:

the-grid-view-in-rstudio.png

Note also that on clicking the matrix in the environment pane,  that a script command has actually sent to the console.  As such vieweing data in this manner can be invoked via a line of script. Using the script editor type:

View(Matrix3Col)
script-in-r-to-create-a-grid-view-in-rstudio.png

Run the line of script to the console:

showing-that-view-in-r-console-is-the-same-as-clicking-the-matrix-in-environment-variables.png