File Carseats has become a function?


#1

In the old days, library(tree) enabled me to use the Carseats file. Now Carseats has become a function. Yet the package ISLR still describes it as a simulated data set. How can I tackle this?
Sorry for the silly question, and thanks for any lead.


#2

Can you describe with sample code what is the issue ?

When I installed ISLR from CRAN, I see a dataset not a function

class(ISLR::Carseats)
#> [1] "data.frame"
head(ISLR::Carseats)
#>   Sales CompPrice Income Advertising Population Price ShelveLoc Age
#> 1  9.50       138     73          11        276   120       Bad  42
#> 2 11.22       111     48          16        260    83      Good  65
#> 3 10.06       113     35          10        269    80    Medium  59
#> 4  7.40       117    100           4        466    97    Medium  55
#> 5  4.15       141     64           3        340   128       Bad  38
#> 6 10.81       124    113          13        501    72       Bad  78
#>   Education Urban  US
#> 1        17   Yes Yes
#> 2        10   Yes Yes
#> 3        12   Yes Yes
#> 4        14   Yes Yes
#> 5        13   Yes  No
#> 6        16    No Yes

Created on 2018-03-31 by the reprex package (v0.2.0).


#3

Thank you very much for your reply, Cristophe.

I’m a lousy coder. From time to time I get back into action
and find out that some details have changed. R is very dynamic. So this time I
needed to install some other package beside ISLR, or my RStudio would not recognize
Carseats. I solved the problem by blind trials.

Thanks again.

Happy Easter.


#4

Great !

Kind you put your question with a "Resolved" Status to indicate it is solved ? Thank you !