\Header{edit.data.frame}{Edit Data Frames and Matrices}
\alias{edit.matrix}{edit.data.frame}
\keyword{utilities}{edit.data.frame}
\begin{Description}\relax
Use data editor on data frame or matrix contents.\end{Description}
\begin{Usage}
\begin{verbatim}
edit.data.frame(name, factor.mode=c("numeric", "character"),
                edit.row.names = any(row.names(name) != 1:nrow(name)),
                ...)
edit.matrix(name, edit.row.names = any(rownames(name)))
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{name}] A data frame or matrix.
\item[\code{factor.mode}] How to handle factors (as integers or using
character levels).
\item[\code{edit.row.names}] logical. Show the row names be displayed as
a separate editable column?
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
At present, this only works on simple data frames containing numeric or
character vectors and factors. Factors are represented in the
spreadsheet as either numeric vectors (which is more suitable for data
entry) or character vectors (better for browsing). After editing,
vectors are padded with \code{NA} to have the same length and
factor attributes are restored. The set of factor levels can not be
changed by editing in numeric mode; invalid levels are changed to
\code{NA} and a warning is issued.  If new factor levels are
introduced in character mode, they are added at the end of the list of
levels in the order in which they encountered.\end{Details}
\begin{Value}
The edited data frame.\end{Value}
\begin{Note}\relax
\code{fix(dataframe)} works for in-place editing by calling this
function.

If the data editor is not available, a dump of the object is presented
for editing using the default method of \code{edit}.\end{Note}
\begin{Author}\relax
Peter Dalgaard\end{Author}
\begin{SeeAlso}\relax
\code{\Link{data.entry}}, \code{\Link{edit}}\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}

data(InsectSprays)
edit(InsectSprays)
edit(InsectSprays, factor.mode="numeric")

\end{ExampleCode}
\end{Examples}

