Data Import
>read.table("mydata.txt")
>read.csv("mydata.csv")
>install.packages("gtools"); install.packages("gdata") # Install the packages "gtools" and "gdata" from the the command
line. You will have to do this only once.
> library(gdata) # load the package "gdata" into the R workspace since it isn't in the R core library
> read.xls("mydata.xls") # open the Excel file "mydata.xls" into the R workspace.
>install.packages("foreign") # installing the package "foreign". You will have to do this only once.
>library(foreign) # load the package "foreign" into the R workspace since it isn't in the R core library
>read.mpt("mydata.mtp") # open the Minitap file "mydata.mtp" into the R workspace.
>install.packages("foreign") # installing the package "foreign". You will have to do this only once.
>library(foreign) # load the package "foreign" into the R workspace since it isn't in the R core library
>read.spss("mydata.spss",to.data.frame=TRUE) # open the SPSS file "mydata.spss" into the R workspace as a data frame.
>install.packages("foreign") # installing the package "foreign". You will have to do this only once.
>library(foreign) # load the package "foreign" into the R workspace since it isn't in the R core library>read.ssd("mydata.ssd")
>read.table(file="http://ramanujan.math.trinity.edu/ekwessi/misc/ACTHJ1.txt",header=TRUE, na.strings="0", fill=TRUE)