Session Ready
Exercise

Extracting meta data about a variable using rxGetVarInfo()

We can extract metadata about individual variables by examining the output from rxGetVarInfo().

Instructions
100 XP

Use rxGetVarInfo() to to extract information about the maximum value of the Closing price of the Dow Jones Industrial Average.

The output of rxGetVarInfo() is a list of class rxGetVarInfo.

Assign the output of rxGetVarInfo() to an object named djiVarInfo and then extract the names of that object using the names() function.

You should see that the names of the djiVarInfo correspond to the names of the variables.

Extract the "Close" element from djiVarInfo and assign it to an object named closeVarInfo.

Use class() and str() to explore closeVarInfo.

Finally, create an object named closeMax that contains the maximum value of the Close variable in the Dow Jones Industrial Average dataset.

The syntax is: rxGetVarInfo(data)

  • data - the dataset for which you want to get variable information.