tclRequire("Tktable", warn = TRUE)
n <- 1000
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", "POSIXt", "Numeric")
col.units <- c("units", NA, "%m/%d/%Y %H:%M", NA)
col.digs <- c(0, NA, NA, 3)
ViewData(d, col.names, col.units, col.digs)
row.names(d) <- 1:n + n
ViewData(d, col.names, col.units = NULL, digs)
Run the code above in your browser using DataLab