There are a number of functions for listing the contents of an object or dataset.
# list objects in the working environment ls()技术支持
# list objects in the working environment ls()
# list the variables in mydata names(mydata)技术支持
# list the variables in mydata names(mydata)
# list the structure of mydata str(mydata)技术支持
# list the structure of mydata str(mydata)
# list levels of factor v1 in mydata levels(mydata$v1)技术支持
# list levels of factor v1 in mydata levels(mydata$v1)
# dimensions of an object dim(object)技术支持
# dimensions of an object dim(object)
# class of an object (numeric, matrix, data frame, etc) class(object)技术支持
# class of an object (numeric, matrix, data frame, etc) class(object)
# print mydata mydata技术支持
# print mydata mydata
# print first 10 rows of mydata head(mydata, n=10)技术支持
# print first 10 rows of mydata head(mydata, n=10)
# print last 5 rows of mydata tail(mydata, n=5)技术支持
# print last 5 rows of mydata tail(mydata, n=5)
Try the free first chapter of this course on cleaning data.
文档
There are a number of functions for listing the contents of an object or dataset.
To Practice
Try the free first chapter of this course on cleaning data.