R object identification
r-programmingdebuggingdata-types
Abstraction: Workflow for inspecting unknown R object types and structure
Key points:
- Primary recommendation:
str(obj)covers 99% of cases for inspecting R object structure - Common inspection sequence:
class(someObject)thenstr(someObject), followed byhead(),summary(), orprint()as needed - Additional functions:
typeof(),class(),sapply(obj, class),sapply(obj, attributes),attributes(),names() - For S3/S4 objects, use
methods(),showMethods(),showClass(); reference: Patrick Burns' R Inferno section 7
Connections: R Programming · Data Types · Debugging
Source: http://stackoverflow.com/questions/1177926/r-object-identification