Learn R Programming

RSurvey (version 0.7-5)

ImportData: Import Data

Description

A GUI for reading table formatted data from a text file.

Usage

ImportData(parent = NULL)

Arguments

parent
tkwin; the GUI parent window.

Value

  • Sets the following components in Data:
  • import.filecharacter; the name of the file which the data is read from.
  • import.fmtslogical; indicates whether the file contains the conversion specification formats of the variables.
  • import.colslogical; indicates whether the file contains the names of the variables.
  • import.skipinteger; the number of lines skiped before data is read.
  • import.sepcharacter; the field separator string.
  • import.deccharacter; used in the file for decimal points.
  • import.nacharacter; string interpreted as NA values.
  • import.quotecharacter; the set of quoting characters.
  • import.commentcharacter; comment character.
  • import.encodingcharacter; encoding that was assumed for input strings, see Encoding.
  • commentcharacter; a vector of comment strings.
  • data.rawdata.frame; the imported (or raw) data table.
  • colslist; length equal to the current number of data variables. Each component in cols is linked to a specific variable, see ManageVariables.

Details

This GUI is a wrapper for the read.table function. Data connections are defined as the path to the file to be opened, a complete URL (e.g. http://, ftp:// or file://), or windows clipboard. Files are limited to text format (.txt .csv, or .tab); however, they can be compressed by http://www.gzip.org/{gzip} with additional extension .gz. Conversion specification formats are the character representation of object types used to: identify column classes prior to reading in data, and format values for printing. Conversion specifications are based on C-style string formatting commands for numeric, integer, and character object classes, see sprintf; for example, a format string of "%.5f" applied to the mathematical constant pi results in "3.14159". Calendar date and time objects of class POSIXct are defined by the ISO C99 / POSIX standard, see strftime; for example, "02/26/2010 02:05:39 PM" is represented using "%d/%m/%Y %I:%M:%S %p". Comments located above data records and header lines are preserved; all other comments are ignored. Requires the specification of a comment character. Performance issues associated with reading in large files can be alleviated by specifying formats in a header line, and giving the maximum number of rows to read in.

See Also

read.table

Examples

Run this code
tclRequire("Tktable", warn = TRUE)
ImportData()

Run the code above in your browser using DataLab