[R] Finding the format of an object redux
Gabor Grothendieck
ggrothendieck at gmail.com
Fri Apr 14 04:26:37 CEST 2006
Look at:
str(obj)
class(obj)
dput(obj)
On 4/13/06, Thomas L Jones <DrJones at alum.mit.edu> wrote:
> Okay, I am dealing with an object. Without going into too much detail,
> a gam (Generalized Additive Model) is involved. Assume that the name
> of the object is "obj" without the quotes. I tell it:
>
> print (obj) inside a function.
>
> I get out a bunch of pairs of lines.
>
> (1) Odd-numbered lines are integers.
> (2) Even-numbered lines have real/floating point numbers.
>
> For example, the first two lines are:
>
> 1 2 3 4 5 6 7
> 8
> 5.354175 5.328358 5.293970 5.264434 5.235172 5.206112 5.177180
> 5.148305
>
> [snip]
>
> The last two integers are 117 and 118; the corresponding real numbers
> are 4.354862 and 4.196938.
>
> Jeepers, creepers, what does all this -MEAN?- Are the integers part of
> the object, or are they indices or subscripts or names or something?
>
> The value of class (obj) is "numeric" including the quotes.
> The value of is.numeric (obj) is TRUE.
> The value of length (obj) is 118.
>
> Well, is this a data frame or a matrix or a table or a vector whose
> elements are vectors of length two? Or a vector with two elements,
> each of which is a vector of length 118? Surely there is a way of
> finding out the answer to this question. Every time I look at the
> documentation, it just tells me to look somewhere else. Is there a
> function f such that f (obj) will tell you a little bit about the
> format of the object?
>
> Tom
> Thomas L. Jones, Ph.D., Computer Science
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
More information about the R-help
mailing list