Viewing Data in R
There are many ways to view data in R. A few of the few common methods are detailed below.
Viewing defined objects via the list function
The list (ls) function returns all of the defined objects (data.frames, vectors, constants, etc) in the current workspace. It does not provide any information regarding the structure or contents of the objects.
 "TestDataFrame" "TestValue" "TestVector"
Viewing defined objects in RStudio
In RStudio, the workspace tab in the Top-Right frame lists all defined objects (along with their structure). The image below in shows an example where the following objects are shown:
Viewing contents of a defined object
The contents of a defined object can be viewed via the view function. The object contents will be shown in a new window.
> View (TestData)
Viewing the mode of an object
The mode of an object provides information regarding what type of data is contained within the object. The mode of an object can be viewed using the mode function.
Viewing the class of an object
For simple vectors the class will be the same as the mode. However, there are other possible values for "matrix", "array", "factor" and "data.frame" objects. The class of an object can be viewed with the class function.
Viewing the length of an object
The length of an object can be viewed using the length function. The length function returns the number of entries for a vector, and the number of variables for a data frame.