rm(list=ls())
mydata <- read.table("clipboard", header=TRUE, sep="\t")
mydata <- read.csv("c:\mydata\mydatafile.csv", header=TRUE)
# The will open a window to search for the *.csv file.
# In the example above, variables have spaces and missing data is coded as ‘-9’
mydata <- read.table(("C:/myfolder/abc.txt", header=TRUE, sep="\t", na.strings = "-9")
mydata <- read.csv(file.choose(), header = TRUE)
library(foreign)
# Load package –-foreign--
mydata.spss <- read.spss("http://dss.princeton.edu/training/mydat a.sav", to.data.frame = TRUE, use.value.labels=TRUE, use.missings = to.data.frame)