1

Is there a function that can print the description / detailed info (what does a variable represent, what are it's units etc.) about the variables that are part of a dataset loaded from a library or package?

Note: I am using jupyter notebook.

Is there a way to check if a dataset has in-built info?

I have loaded the datasets from the library (ISLR) for the book "Introduction to Statistical Learning with R."

I want to see the description of the variables included in the 'College' dataset like : Top10perc, Outstate, etc.

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

For ex:
(got this description from a pdf for the package ISLR)

__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
rahul-ahuja
  • 1,166
  • 1
  • 12
  • 24

2 Answers2

3

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

G. Grothendieck
  • 254,981
  • 17
  • 203
  • 341
  • Yes, this worked. Is there a way to print it ? I am using Jupyter Notebook. – rahul-ahuja Jan 02 '21 at 03:19
  • Bring up the help file you want in the browser and press ctrl p . If you want the entire reference manual of all help files for the package go to the CRAN home page for the package, click on the reference manual link and when it appears in your pdf reader use its facilities to print it. Depending on how your system is configured it may be ctrl p as well. – G. Grothendieck Jan 02 '21 at 03:26
1

This should help you

```{r}
library(ISLR)
?ISLR
```
Simon
  • 11
  • 3