str()

str()

The str() function will display the internal data structure of an R object (such as a data frame). It will return information about the rows (observations) and columns (variables) along with extra information like the names of the columns, class of each column, followed by some of the initial observations of each of the columns.

Example:

# Get information about the structure of MindsetMatters

str( MindsetMatters )

Example output:
Example output of str function showing structure of MindsetMatters

    • Related Articles

    • The Pipe Operator %>%

      The Pipe Operator %>%  What it is In R, %>% is called the "pipe" operator.  It  takes the output of one statement and uses it as the input for the following statement. Another way of saying this is that it "pipes" or "chains" together a string of ...
    • Page Won't Load or Button Doesn't Work

      Page Won't Load / Button Doesn't Work The problem:  You click on a page in CourseKata and the content won't load (page won't load) You click on a button in CourseKata and nothing happens (button doesn't work) What to try:  Note: the suggestions below ...