This function retrieves the number of observations from a given object.
Arguments
- x
The input object, which can be of different types, such as a data frame, matrix, or a custom object with a defined `nobs` method.
Value
The number of observations in the input object. Depending on the object type, this could be the number of rows or elements.