Suppose you're working with a dataset in R and you want to check the data type of a certain variable. How would you do it?

  • Either of the above
  • None of the above
  • Use the class() function
  • Use the typeof() function
Both typeof() and class() functions in R can be used to check the data type of a variable. While typeof() returns the internal storage mode, class() returns the attributes of the object as how it should be treated in context of object-oriented programming.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *