R check object dimensions

To check the dimensions of an object in R, you can use the dim() function. First, you need to specify the object for which you want to check the dimensions. Then, you can use the dim() function with the object as an argument to get the dimensions. For example, if you have a data frame called my_data, you can use dim(my_data) to get the dimensions of the data frame. The result will be a vector with the number of rows and columns in the object, in that order.