R object identification -
I often end up with output output for which I do not understand the output data type. I am expecting a list and it ends up with lists or data frames or something else. What is the best way to find out the output data type when using the first time function or workflow?
I usually (obj, class) sapply (obj, attribute) names of attributes (obj) Obj)
starting with some combination of obj class (obj) sapply: / ex> As appropriate as it is found, it is appropriate on its basis. For example, try with:
obj & lt; - data.frame (a = 1: 26, b = letter) obj & lt; - List (a = 1: 26, b = letters, C = list (d = 1: 26, e = letter)) data (car) obj & lt; - Lm (dist ~ speed, data = cars)
.. etc ..
If obj
is an S3 or S4 object, you can see the methods
or showMethods
, showClass , etc. Patrick Burns has a very nice section on it (Sec # 7). Edit : The mention of Dirk and Hadley str (obj)
In their reply, it is actually a quick and detailed detailed information The above is better than anyone above.
Comments
Post a Comment