Rev 27442 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{edit.data.frame}\alias{edit.data.frame}\alias{edit.matrix}\title{Edit Data Frames and Matrices}\description{Use data editor on data frame or matrix contents.}\usage{\method{edit}{data.frame}(name, factor.mode = c("character", "numeric"),edit.row.names = any(row.names(name) != 1:nrow(name)), \dots)\method{edit}{matrix}(name, edit.row.names = any(rownames(name) != 1:nrow(name)), \dots)}\arguments{\item{name}{A data frame or matrix.}\item{factor.mode}{How to handle factors (as integers or usingcharacter levels) in a data frame.}\item{edit.row.names}{logical. Show the row names be displayed asa separate editable column?}\item{\dots}{further arguments passed to or from other methods.}}\details{At present, this only works on simple data frames containing numeric,logical or character vectors and factors. Factors are represented in thespreadsheet as either numeric vectors (which is more suitable for dataentry) or character vectors (better for browsing). After editing,vectors are padded with \code{NA} to have the same length andfactor attributes are restored. The set of factor levels can not bechanged by editing in numeric mode; invalid levels are changed to\code{NA} and a warning is issued. If new factor levels areintroduced in character mode, they are added at the end of the list oflevels in the order in which they encountered.It is possible to use the data-editor's facilities to select the modeof columns to swap between numerical and factor columns in a dataframe. Changing any column in a numerical matrix to character willcause the result to be coerced to a character matrix. Changingthe mode of logical columns is not supported.}\value{The edited data frame.}\author{ Peter Dalgaard }\note{\code{fix(dataframe)} works for in-place editing by calling thisfunction.If the data editor is not available, a dump of the object is presentedfor editing using the default method of \code{edit}.At present the data editor is limited to 65535 rows.}\seealso{\code{\link{data.entry}}, \code{\link{edit}}}\examples{\dontrun{data(InsectSprays)edit(InsectSprays)edit(InsectSprays, factor.mode="numeric")}}\keyword{utilities}