When should I use a dataframe vs. a matrix? What are the pros and cons?
If I have data of all the same type, am I usually better off using a
matrix and not a dataframe?
What are the advantages if any of using a dataframe vs. a matrix?
(rownames and column names perhaps?)
Anika -- these are good questions and many on the list could
expatiate on them. These erudite people are also busy, however, and
that is why the R-news posting guide suggests that you study an
introductory book on R before asking general questions.
On 27-Jun-13, at 11:26 AM, Anika Masters
.
- Original Message -
From: Anika Masters anika.mast...@gmail.com
To: R help r-help@r-project.org
Cc:
Sent: Thursday, June 27, 2013 2:26 PM
Subject: [R] when to use pros/cons of dataframe vs. matrix?
When should I use a dataframe vs. a matrix? What are the pros and cons?
If I have data
Hello,
Arun's answer shows that matrices are faster. If your data is all of the
same type, then this might be a point for matrices.
data.frames are better for modeling. You can use the formula interface
to the many modeling functions. For instance, the example below is _not_
possible with a
4 matches
Mail list logo