A widget for importing data to R
Functions constructs a widget that allows users to inport data file to R. The imported data will be returned as an R data frame together with the argument list used to import the data using read.table
importWizard(filename = "", maxRow = 400) initImportWizard(env) getTopCan(base, env) getAFrame(base, env) finish(env) getState1Frame(base, env) setState1BFrame(frame, env) setState1TFrame(frame, viewer, delims, env, startList) showData4State1(widget, env) setState1MFrame(frame, env, dataViewer) getState2Frame(base, env, state = "state2", reset = FALSE) setState2MFrame(frame,env) setSepRadios(frame, env, state = "state2") setQuoteList(frame, env) setQuote(listBox, env, state = "state2") setState2BFrame(frame, env) showData4State2(canvas, env, state = "state2") getState3Frame(base, env) setState3TFrame(frame, env) setState3BFrame(frame, env) getName4Data(filename, objType) writeCol4Matrix(tempFrame, dataFile, colInfos, env) popStartLine(startList, env) readFileByLines(filename)
filename |
|
maxRow |
|
env |
|
base |
|
frame |
|
viewer |
|
delims |
|
widget |
|
state |
|
listBox |
|
canvas |
|
tempFrame |
|
dataFile |
|
colInfos |
|
reset |
|
dataViewer |
|
objType |
|
startList |
|
importWizard
mimics the interface of MS Excel and
collects arguments for the function read.table
. Due to
performace concern, a maximum number of rows (maxRow) set by
users will be displayed. Overly long data set may cause slow response
of the system.
initImportWizard
initializes the interface for
importWizard by creating a widget with an empty top canvas and bottom
frame filled with four buttons.
getTopCan
Creates a canvas that is going to be filled by
a frame created by other functions depending on the state of the
importing process.
getAFrame
Gets a frame for the canvas created by
initImportWizard
based on the current state of importing
process.
finish
Finishes the importing process and returns a data
frame read from a file using read.table
.
getState1Frame
Returns a tcltk frame containing a list
box to show a data file read by readLines
and widgets
for user imports.
setState1BFrame
Fills the bottom frame of the frame
created by getState1Frame
with a list box.
setState1TFrame
Fills the top frame of the frame
created by getState1Frame
with a list box.
showData4State1
Populates a tcltk list or text widget
with data read using readLines.
setState1MFrame
Fills the mid frame of the frame
created by getState1Frame
.
getState2Frame
Returns a tcltk frame containing a canvas
to show a data file read by read.table
and widgets
for user imports.
setState2MFrame
Fills the mid frame of the frame
created by getState2Frame
.
setSepRadios
Renders radio buttons for options of file
separators in the frame created by setState2MFrame
.
setQuoteList
Renders the selection list for the quote
used by a data file in the frame created by
setState2MFrame
.
setQuote
Sets the value when a user has selected the
quote used by a data file.
setState2BFrame
Fills the bottom frame of the frame
created by getState2Frame
with a canvas.
showData4State2
Populates the canvas created by
setState2BFrame
using data read by
read.table
.
getState3Frame
Returns a tcltk frame containing a canvas
to show a data file read by read.table
and widgets
for user imports.
setState3TFrame
Fills the top frame of the frame
created by getState3Frame
.
setState3BFrame
Fills the bottom frame of the frame
created by getState3Frame
.
getName4Data
Takes user input for a file name using a
widget.
writeCol4Matrix
Creates a tcltk frame with list boxes as
columns displaying data of a data matrix.
getTopCan
returns a tcltk canvas.
getAFrame
returns a tcltk frame.
finish
returns a data.frame.
getState1Frame
returns a tcltk frame with several
widgets.
setState1BFrame
returns the tkwin object of list box.
getState2Frame
returns a tcltk frame with several
widgets.
getState3Frame
returns a tcltk frame with several
widgets.
getName4Data
returns a character string for the name of
a file to be saved.
Jianhua Zhang
if(interactive()){ importWizard() }
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.