Lumenize icon indicating copy to clipboard operation
Lumenize copied to clipboard

R function str()

Open jmaccherone opened this issue 12 years ago • 2 comments

The str() function reveals the structure used to store a data object.

It returns output such as 'data.frame" with details about number of "observations" (cases or instances), variables, "Factors"(labels of groups), "levels" (count of factors), mode(type of data).

str(myFamily) 'data.frame': 5 obs. of 4 variables: $ myFamilyNames : Factor w/ 5 levels "Bro","Dad","Dog",..: 2 4 5 1 3 $ myFamilyAges : num 43 42 12 8 5 $ myFamilyGenders: Factor w/ 2 levels "Female","Male": 2 1 1 2 1 $ myFamilyWeights: num 188 136 83 61 44

jmaccherone avatar May 08 '13 16:05 jmaccherone

Jen, also, I seem to be missing the concepts of data frames and vectors.

lmaccherone avatar Jun 16 '13 23:06 lmaccherone

I guess the easiest way to think of it is an vector is like an array : {1, 2, 3, 4, 5, 6 ,7} and a data frame is like a matrix of rows and columns.

screen shot 2013-06-26 at 8 45 41 am

jmaccherone avatar Jun 26 '13 12:06 jmaccherone