########## ## # Reading the data into R: my.datafile <- tempfile() cat(file=my.datafile, " 1 7 692 150 408 0 0 1 0 508 2 7 765 100 334 0 0 1 1 553 3 8 764 150 170 0 0 1 1 488 4 13 808 100 533 0 1 1 1 558 5 7 685 100 264 0 0 0 0 471 6 7 710 100 296 0 0 0 0 481 7 5 718 100 240 0 1 1 1 577 8 6 672 100 420 0 1 0 1 556 9 4 746 100 410 1 1 1 1 636 10 4 792 100 404 1 0 1 1 737 11 8 797 150 252 0 0 1 1 546 12 7 708 100 276 0 0 1 0 445 13 8 797 150 252 0 0 0 1 533 14 6 813 100 416 0 1 0 0 617 15 7 708 100 536 0 0 1 1 475 16 16 658 100 188 1 1 1 1 525 17 8 809 150 192 0 0 1 0 461 18 7 663 100 300 0 0 0 1 495 19 1 719 100 300 1 1 1 1 601 20 1 689 100 224 0 1 1 1 567 21 1 737 175 310 1 1 1 1 633 22 1 694 150 476 1 0 1 1 616 23 7 768 150 264 0 0 1 1 507 24 6 699 150 150 0 0 0 0 454 25 6 733 100 260 0 0 1 0 502 26 7 592 100 264 0 0 1 1 431 27 6 589 150 516 0 0 1 1 418 28 8 721 75 216 0 0 1 0 538 29 5 705 75 212 1 0 1 1 506 30 6 772 150 460 0 0 1 1 543 31 7 758 100 260 0 0 1 0 534 32 7 764 100 269 0 0 1 0 536 33 6 722 125 216 0 0 0 1 520 34 1 703 100 248 0 0 1 0 530 ", sep=" ") options(scipen=999) # suppressing scientific notation apartment <- read.table(my.datafile, header=FALSE, col.names=c('obs','age','sqft','sd','unts','gar','cp','ss','fit','rent')) # Note we could also save the data columns into a file and use a command such as: # apartment <- read.table(file = "z:/stat_516/filename.txt", header=FALSE, col.names = c('obs','age','sqft','sd','unts','gar','cp','ss','fit','rent')) attach(apartment) # The data frame called apartment is now created. #########