Description

Opens a data set or workspace from a file. Using read.table and the foreign package, this dialog supports the following file types:

File TypeExtension
R workspace*.rda and *.rdata
R object*.robj
Comma separated*.csv
Text file*.txt
SPSS*.sav
SAS export*.xpt
DBase*.dbf
Stata*.dta
Systat*.sys and *.syd
ARFF*.arff
Epiinfo*.rec
Minitab*.mtp
S data dump*.s3

Dialog

The 'Open Data' dialog is located under the 'File' menu. Simply select the file to be loaded from the file system, and click 'Open'. The R name which this data is loaded to can be changed by entering a value into the 'Set Name' field in the lower left hand corner.

If the file is not a text file or a comma separated file, it will be loaded into the workspace. Otherwise a supplemental dialog will be displayed showing a preview of the data file to make sure that the settings are correct.

The 'Record Separator' option allows one to specify what character separates values in the data set. The 'Quote' option lets one define whether the data file defines character variables by surrounding them by quotation marks. The 'Header' option specifies whether the first row contains the variable names.

R Code

The function called by this dialog will depend on the type of data loaded. The example above produces the following read.table call:

temporary.data <- read.table("/Users/Ian/temp.csv",header=T,sep=",",quote="\"")

Other functions that this dialog supports are:

load

dget

read.spss

read.xport

read.dta

read.arff

read.epiinfo

read.mtp

data.restore

read.systat

read.dbf