fileWizard: A function that import a text file into R

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/fileWizard.R

Description

Given a file name, this function imports the text file into R.

Usage

1
2
fileWizard(filename = "", fun = read.table, file = "file",
basic = c("header", "sep"), getFocus = TRUE)

Arguments

filename

A character string for the name of the text file to be imported

fun

An R function that is going to be used to read the file. Default to read.table

file

A character string for the name of the argument to fun that defines the name of the file to be read

basic

A vector of character strings for names of the arguments to fun that will have separate entry boxes on the widget to be produced. Default to "header" and "sep"

getFocus

getFocus a boolean indicating whether a widget should grab the focus

Details

This function is only partially finished and will be improved soon. It currently allows uesrs to view a given file and change the settings for header and sep arguments of read.table. A file will be read in based on the values of the two arguments and return.

Value

This function returns a data frame for the file read in.

Author(s)

Jianhua Zhang

References

R News Vol. 1/3, September 2001

See Also

fileBrowser

Examples

1
2
3
4
if(interactive()) {
  # Only the interface is displyed as no real file is given
  fileWizard()  
}

Example output

Loading required package: widgetTools
Loading required package: tcltk
Loading required package: DynDoc
Loading required package: tools
Warning message:
no DISPLAY variable so Tk is not available 

tkWidgets documentation built on Nov. 8, 2020, 5:17 p.m.