![]() Setwd("direction to the downloaded data") (1) If you downloaded if save file Auto in your computer already The example script (corresponding to what I mentioned above) ISLR), once you have loaded the ISLR package with the “library” command, you do not need to use the “read.table” command to load the “Auto” data. ![]() It seems that there are two ways to read data: (1) download it and save it in your working folder, then call it or download it directly from the internet (2) when working with a package (i.e. So I reach the conclusion below, pls correct me if I am wrong (since I am almost a newbie, as well) I also cope with the same problem and have solved it. Once the file is saved with the name Auto.data in the working directory, the command Auto <- read.table("Auto.data")īetter results will be obtained using Auto <- read.table("Auto.data", header=TRUE) Here is the link to the file that should be saved in the working directory: ( The text fileĭata frame can be obtained from this book’s website.) The followingĬommand will load the Auto.data file into R and store it as an objectĬalled Auto, in a format referred to as a data frame. Read.table() function we load it now from a text file. ISLR library (we discuss libraries in Chapter 3) but to illustrate the We begin by loading in the Auto data set. ![]() Mpg cylinders displacement horsepower weight acceleration year origin nameġ 18 8 3 12.0 70 1 chevrolet chevelle malibu Then the Auto dataset becomes immediately available: > head(Auto) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |