Extracting meta data about a variable using rxGetVarInfo()
We can extract metadata about individual variables by examining the output from rxGetVarInfo().
This exercise is part of the course
Big Data Analysis with Revolution R Enterprise
Exercise instructions
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.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
## get variable information for the dataset
djiVarInfo <- rxGetVarInfo(___)
___(djiVarInfo)
## extract information about the closing cost variable
(closeVarInfo <- djiVarInfo___)
## get the class of the closeVarInfo object:
class(___)
## examine the structure of the closeVarInfo object:
___(closeVarInfo)
## extract the global maximum of the closing cost variable:
closeMax <- closeVarInfo[["___"]]