0

是否有一个函数可以打印关于作为从库或包加载的数据集的一部分的变量的描述/详细信息(变量代表什么,它的单位是什么等)?

注意:我正在使用 jupyter 笔记本。

有没有办法检查数据集是否有内置信息?

我已经从库 (ISLR) 中加载了“R 统计学习简介”一书的数据集。

我想查看“College”数据集中包含的变量的描述,例如:Top10perc、Outstate 等。

# load library
library(ISLR)
df = College        # saved data with a generic name 'df'

例如:(从包 ISLR的pdf
中 获得此描述)

__College__   
U.S. News and World Report’s College Data

__Description__   
Statistics for a large number of US Colleges from the 1995 issue of US News and World Report.

__Format__ 
A data frame with 777 observations on the following 18 variables.

Private A factor with levels No and Yes indicating private or public university
Apps Number of applications received
Accept Number of applications accepted
Enroll Number of new students enrolled
Top10perc Pct. new students from top 10% of H.S. class
Top25perc Pct. new students from top 25% of H.S. class
F.Undergrad Number of fulltime undergraduates
P.Undergrad Number of parttime undergraduates
Outstate Out-of-state tuition
Room.Board Room and board costs
Books Estimated book costs
Personal Estimated personal spending
PhD Pct. of faculty with Ph.D.’s
Terminal Pct. of faculty with terminal degree
S.F.Ratio Student/faculty ratio
perc.alumni Pct. alumni who donate
Expend Instructional expenditure per student
Grad.Rate Graduation rate
4

2 回答 2

2

They are typically documented in help files. For example, to get the documentation on the Auto data set:

library(ISLR)
?Auto

This will show all of the help files and you can click through to get more information.

help(packages = "ISLR")

Alternately, the help files are assembled into a Reference Manual and that can be readily accessed on the CRAN home page of the package, e.g. https://cran.r-project.org/package=ISLR

于 2021-01-02T03:08:31.893 回答
0

这应该可以帮助你

```{r}
library(ISLR)
?ISLR
```
于 2021-01-02T03:18:23.870 回答