Codes use in presentation

setwd("e:/rdir")   #set working directory
read.table("data1.txt",header=T)  #read a text file


file.choose() #view what files are available


read.delim("clipboard",header=T) #copy from excel file to clipboard, then read into R


library() # use for spss -- make sure you create a spss portable file
library(foreign)
data1<-read.spss("data1.por",to.data.frame=T)