Jason Rupert
2009-Feb-26 23:15 UTC
[R] Something similar to data.frame, but allows variables with unique lengths?
I have a tightly coupled collection of variables with different lengths and types (some characters and others numerics). I looked at the documentation for data.frame, but indicates that it expects all variables to have the same length, i.e. number of elements. I was hoping the "See Also" documentation for data.frame would have helped, but it did not have any good leads. Here is a list of data I would like to store together: (FileName (character string), HighValue (numeric), LowValue (numeric), Units (character), OthersValues (array of numerics), Descriptor (character string)) By any chance is there a generic object type feature within R to store such data together in one variable? Thank you for any details and leads you can provide. [[alternative HTML version deleted]]
jim holtman
2009-Feb-26 23:57 UTC
[R] Something similar to data.frame, but allows variables with unique lengths?
?list On Thu, Feb 26, 2009 at 6:15 PM, Jason Rupert <jasonkrupert at yahoo.com> wrote:> I have a tightly coupled collection of variables with different lengths and types (some characters and others numerics).? I looked at the documentation for data.frame, but indicates that it expects all variables to have the same length, i.e. number of elements. > > I was hoping the "See Also" documentation for?data.frame?would have helped, but it did not have any good leads. > > Here is a list of data I would like to store together: > (FileName (character string), > ?HighValue (numeric), > ?LowValue (numeric), > ?Units (character), > ?OthersValues?(array of numerics), > ?Descriptor?(character string)) > > By any chance is there a generic object type feature within R to store such data together in one variable? > > Thank you for any details and leads you can provide. > > > > > > ? ? ? ?[[alternative HTML version deleted]] > > > ______________________________________________ > 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. > >-- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve?
Domenico Vistocco
2009-Feb-27 00:07 UTC
[R] Something similar to data.frame, but allows variables with unique lengths?
Jason Rupert wrote:> I have a tightly coupled collection of variables with different lengths and types (some characters and others numerics). I looked at the documentation for data.frame, but indicates that it expects all variables to have the same length, i.e. number of elements. >I think you are looking for the list obiect (the data.frame is a particular list with the constrain that each element have to be of the same length). See: ?list chapter 6 of An Introduction to R Ciao, domenico> > I was hoping the "See Also" documentation for data.frame would have helped, but it did not have any good leads. > > Here is a list of data I would like to store together: > (FileName (character string), > HighValue (numeric), > LowValue (numeric), > Units (character), > OthersValues (array of numerics), > Descriptor (character string)) > > By any chance is there a generic object type feature within R to store such data together in one variable? > > Thank you for any details and leads you can provide. > > > > > > [[alternative HTML version deleted]] > > > ------------------------------------------------------------------------ > > ______________________________________________ > 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. >