########## ## # Reading the data into R: my.datafile <- tempfile() cat(file=my.datafile, " 01 71 15 11.50 130 02 74 19 12.23 149 03 70 11 12.26 170 04 71 15 12.65 177 05 69 12 10.26 188 06 73 17 12.76 210 07 72 15 11.89 223 08 75 19 12.32 170 09 72 16 10.77 145 10 74 18 11.31 132 11 71 13 12.91 211 12 72 15 12.55 212 13 73 17 11.72 193 14 72 16 12.94 146 15 71 15 12.21 158 16 75 20 11.81 154 17 71 15 11.90 193 18 75 19 11.22 228 19 78 22 10.89 217 20 79 23 12.84 172 21 72 16 11.01 188 22 75 20 12.18 144 23 76 21 12.37 164 24 74 19 11.98 188 25 70 13 12.23 231 ", sep=" ") options(scipen=999) # suppressing scientific notation basketball <- read.table(my.datafile, header=FALSE, col.names=c("id", "height", "goalmade", "dash100", "weight")) # Note we could also save the data columns into a file and use a command such as: # basketball <- read.table(file = "z:/stat_516/filename.txt", header=FALSE, col.names = c("id", "height","goalmade", "dash100", "weight")) attach(basketball) # The data frame called basketball is now created. #########