Thomas L Jones, PhD
2007-Dec-08 20:07 UTC
[R] Function to tell you how an object is put together
Question: Suppose I have an arbitrary object. Is there a function which will accept the object as an argument and sort of give the format of the object, how it is put together, etc.? The analysis would include the attributes and the names of the attributes. Also, things like whether or not the object is an array; whether or not it is a matrix, etc. Tom Jones
Ingmar Visser
2007-Dec-10 09:23 UTC
[R] Function to tell you how an object is put together
str goes a long way in doing that hth, Ingmar On 8 Dec 2007, at 21:07, Thomas L Jones, PhD wrote:> Question: Suppose I have an arbitrary object. Is there a function > which will > accept the object as an argument and sort of give the format of > the object, > how it is put together, etc.? The analysis would include the > attributes and > the names of the attributes. Also, things like whether or not the > object is > an array; whether or not it is a matrix, etc. > > Tom Jones > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code.Ingmar Visser Department of Psychology, University of Amsterdam Roetersstraat 15 1018 WB Amsterdam The Netherlands t: +31-20-5256723 [[alternative HTML version deleted]]
Dimitris Rizopoulos
2007-Dec-10 09:40 UTC
[R] Function to tell you how an object is put together
probably you're looking for str(), e.g., lis <- list(x = 1:10, y = letters[1:3]) str(lis) I hope it helps. Best, Dimitris ---- Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax: +32/(0)16/337015 Web: http://med.kuleuven.be/biostat/ http://www.student.kuleuven.be/~m0390867/dimitris.htm ----- Original Message ----- From: "Thomas L Jones, PhD" <jones3745 at verizon.net> To: "R-project help" <r-help at stat.math.ethz.ch> Sent: Saturday, December 08, 2007 9:07 PM Subject: [R] Function to tell you how an object is put together> Question: Suppose I have an arbitrary object. Is there a function > which will > accept the object as an argument and sort of give the format of the > object, > how it is put together, etc.? The analysis would include the > attributes and > the names of the attributes. Also, things like whether or not the > object is > an array; whether or not it is a matrix, etc. > > Tom Jones > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm