########## ## # Reading the data into R: my.datafile <- tempfile() cat(file=my.datafile, " 1 15 1 20 1 19 1 14 2 11 2 15 2 11 3 18 3 19 3 23 ", sep=" ") options(scipen=999) # suppressing scientific notation banks <- read.table(my.datafile, header=FALSE, col.names=c("branch", "leave")) # Note we could also save the data columns into a file and use a command such as: # banks <- read.table(file = "z:/stat_516/filename.txt", header=FALSE, col.names = c("branch", "leave")) attach(banks) # Making "branch" a factor: branch <- factor(branch) # The data frame called banks is now created. #########