The object-handling utility of the R language can be thought of as a toolset for parsing variables (or objects), similar to the reflection functionality in Java, but easier to use.
The practical functions for working with data objects are shown in the following table:
Function |
Use |
Length (object) |
Displays the number of elements/components in the object |
Dim (object) |
Display the dimensions of an object |
Str (object) |
Show the structure of an object |
Class (Object) |
Display the class or type of an object |
Mode (object) |
Show the mode of an object |
Names (object) |
Displays the names of the components in an object |
C (Object, Object,...) |
Merging objects into a vector |
Cbind (Object, object, ...) |
Merging objects by column |
Rbind (Object, object, ...) |
Merging objects by rows |
Object |
Output an Object |
Head (object) |
List the starting part of an object |
Tail (object) |
List the last part of an object |
LS () |
Displays the current list of objects |
Rm (Object, object, ...) |
Deletes one or more objects. The statement rm (list = ls ()) deletes almost all objects in the current working environment * |
NewObject <-Edit (object) |
Edit the object and save as NewObject |
Fix (object) |
Edit objects directly |
R language Learning-Object handling utility function