edit.data.frame            package:utils            R Documentation

_E_d_i_t _D_a_t_a _F_r_a_m_e_s _a_n_d _M_a_t_r_i_c_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     Use data editor on data frame or matrix contents.

_U_s_a_g_e:

     ## S3 method for class 'data.frame':
     edit(name, factor.mode = c("character", "numeric"),
          edit.row.names = any(row.names(name) != 1:nrow(name)), ...)

     ## S3 method for class 'matrix':
     edit(name, edit.row.names = !is.null(dn[[1]]), ...)

_A_r_g_u_m_e_n_t_s:

    name: A data frame or (numeric, logical or character) matrix.

factor.mode: How to handle factors (as integers or using character
          levels) in a data frame.

edit.row.names: logical. Show the row names (if they exist) be
          displayed as a separate editable column?  It is an error to
          ask for this on a matrix with 'NULL' row names.

     ...: further arguments passed to or from other methods.

_D_e_t_a_i_l_s:

     At present, this only works on simple data frames containing
     numeric, logical or character vectors and factors, and numeric,
     logical or character matrices.  Any other mode of matrix will give
     an error, and a warning is given when the matrix has a class
     (which will be discarded).

     Data frame columns are coerced on input to _character_ unless
     numeric (in the sense of 'is.numeric'), logical or factor.  A
     warning is given when classes are discarded.  Special characters
     (tabs, non-printing ASCII, etc.) will be displayed as escape
     sequences.

     Factors columns are represented in the spreadsheet as either
     numeric vectors (which are more suitable for data entry) or
     character vectors (better for browsing). After editing, vectors
     are padded with '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 '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.

     It is possible to use the data-editor's facilities to select the
     mode of columns to swap between numerical and factor columns in a
     data frame.  Changing any column in a numerical matrix to
     character will cause the result to be coerced to a character
     matrix.  Changing  the mode of logical columns is not supported.

     For a data frame, the row names will be taken from the original
     object if 'edit.row.names = FALSE' and the number of rows is
     unchanged, and from the edited output if 'edit.row.names = TRUE'
     and there are no duplicates.  (If the 'row.names' column is
     incomplete, it is extended by entries like 'row223'.)  In all
     other cases the row names are replaced by 'seq(length=nrows)'.

     For a matrix, colnames will be added (of the form 'col7') if
     needed.  The rownames will be taken from the original object if
     'edit.row.names = FALSE' and the number of rows is unchanged
     (otherwise 'NULL'), and from the edited output if 'edit.row.names
     = TRUE'.  (If the 'row.names' column is incomplete, it is extended
     by entries like 'row223'.)

     Editing a matrix or data frame will lose all attributes apart from
     the row and column names.

_V_a_l_u_e:

     The edited data frame or matrix.

_N_o_t_e:

     '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 'edit'.

     At present the data editor is limited to 65535 rows.

_A_u_t_h_o_r(_s):

     Peter Dalgaard

_S_e_e _A_l_s_o:

     'data.entry', 'edit'

_E_x_a_m_p_l_e_s:

     ## Not run: 
     edit(InsectSprays)
     edit(InsectSprays, factor.mode="numeric")
     ## End(Not run)

