Observe Data in R: str(), head(), summary() Functions
In R language, there are several methods available to observe imported data.
- Use the str() function to examine the structure of the dataframe, including the name and type of each variable, as well as the first few rows of data.
- Use the head() function to view the first few rows of the data frame.
- Use the summary() function to view the statistical summary of the data frame, including the minimum, maximum, and average values of each variable.
- To view the complete contents of a data frame in RStudio, you can select “View” by right-clicking on the data frame name.
- Use the names() function to view the column names of a data frame.
- Use the dim() function to check the number of rows and columns in a data frame.
By using the methods mentioned above, it is possible to comprehensively observe the imported data and gain a preliminary understanding and analysis of the data.