str Flashcards
1
Q
str
A
compactly display the internal structure of an R object
diagnostic function, more detailed than summary
useful for exploratory data analysis on R objects, when you don’t know what’s there
2
Q
When str is called on a numeric vector, how does the output differ from summary?
A
summary gives you summary statistics on the elements of the vector
str() tells you it’s a numeric vector, tells you there are 100 elements in the vector, and prints the first few elements of the vector
In general, str is smarter about how it summarizes an object or function