EditData: GUI: Data Editor

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

View source: R/EditData.R

Description

A graphical user interface (GUI) for viewing and editing table formatted data.

Usage

1
2
3
EditData(d, col.names = names(d), row.names = NULL, col.formats = NULL,
  read.only = FALSE, changelog = NULL, win.title = "Data",
  parent = NULL)

Arguments

d

list, matrix, or data.frame. Data used to populate the data table.

col.names

character. Vector of column names

row.names

character. Vector of row names

col.formats

character. Vector of format conversion specification strings, see sprintf and strftime.

read.only

logical. Specifies whether the data table is in read only mode.

changelog

data.frame. History of all data table edits, see ‘Value’ section.

win.title

character. String to display as the title of the dialog box.

parent

tkwin. GUI parent window

Details

Row titles are taken from the row names attribute of argument d. Pattern searches are performed using grep. Edits are reflected in the changelog.

Value

Returns NULL if no edits were made; otherwise, new values of d and changelog are returned as components in a list. The changelog data table contains the following variables:

timestamp

a date-time value that identifies when the edit event occurred.

record

row name

variable

column name

old

value before editing

new

value after editing

Note

Requires the Tcl package Tktable.

Author(s)

J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center

See Also

BuildHistogram

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 
  tcltk::tclRequire("Tktable", warn = TRUE)

  n <- 1000L
  V1 <- sample(c(1:9, NA), n, replace = TRUE)
  V2 <- sample(LETTERS, n, replace = TRUE)
  V3 <- as.POSIXct(rnorm(n, mean = 0, sd = 1e6), origin = "2010-01-01")
  V4 <- sample(V1 * pi, n)
  d <- data.frame(V1, V2, V3, V4)
  col.names <- c("Integers", "Letters", "DateTime", "Numeric")
  col.formats <- c("%d", "%s", "%m/%d/%Y %H:%M", "")
  obj <- EditData(d, col.names, col.formats)
  str(obj)

  rownames(d) <- paste0(sample(LETTERS, n, replace = TRUE), seq_len(n))
  EditData(d, read.only = TRUE)

  colnames(d) <- NULL
  rownames(d) <- NULL
  EditData(d, read.only = TRUE)

## End(Not run)

RSurvey documentation built on Nov. 23, 2017, 9:03 a.m.