Observe Data in R: str(), head(), summary() Functions

In R language, there are several methods available to observe imported data.

  1. 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.
  2. Use the head() function to view the first few rows of the data frame.
  3. Use the summary() function to view the statistical summary of the data frame, including the minimum, maximum, and average values of each variable.
  4. To view the complete contents of a data frame in RStudio, you can select “View” by right-clicking on the data frame name.
  5. Use the names() function to view the column names of a data frame.
  6. 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.

bannerAds