Reading datasets into R
Several datasets have been created for this book and can be downloaded from the website for this book as text files. These text files also provide the R code for each chapter. Alternatively, copy the relevant CSV file into a convenient folder, make sure that the R working directory matches your folder, and use the read.csv()
command. For example, to read a CSV file called Patients
as the object T
, enter the following syntax:
T <- read.csv("Patients.csv", h=T)
Further explanations on reading datasets will be given in this chapter.