edit                  package:base                  R Documentation

_I_n_v_o_k_e _a _T_e_x_t _E_d_i_t_o_r

_D_e_s_c_r_i_p_t_i_o_n:

     Invoke a text editor on an R object.

_U_s_a_g_e:

     edit(name = NULL, file = "", editor = getOption("editor"))
     vi(name = NULL, file = "")
     emacs(name = NULL, file = "")
     pico(name = NULL, file = "")
     xemacs(name = NULL, file = "")
     xedit(name = NULL, file = "")

_A_r_g_u_m_e_n_t_s:

    name: a named object that you want to edit. If name is missing then
          the file specified by `file' is opened for editing.

    file: a string naming the file to write the edited version to.

  editor: a string naming the text editor you want to use. On Unix the
          default is set from the `EDITOR' environmental variable. On
          Windows it defaults to `notepad'.

_D_e_t_a_i_l_s:

     `edit' invokes the text editor specified by `editor' with the
     object `name' to be edited. It is a generic function, currently
     with a default method and one for data frames.

     `data.entry' can be used to edit data, and is used by `edit' to
     edit matrices and data frames on systems for which `data.entry' is
     available.

     It is important to realize that `edit' does not change the object
     called `name'. Instead, a copy of name is made and it is that copy
     which is changed. Should you want the changes to apply to the
     object `name' you must assign the result of `edit' to `name'. (Try
     `fix' if you want to make permanent changes to an object.)

     In the form `edit(name)', `edit' deparses `name' into a temporary
     file and invokes the editor `editor' on this file. Quitting from
     the editor causes `file' to be parsed and that value returned.
     Should an error occur in parsing, possibly due to incorrect
     syntax, no value is returned. Calling `edit()', with no arguments,
     will result in the temporary file being reopened for further
     editing.

_N_o_t_e:

     The functions `vi', `emacs', `pico', `xemacs', `xedit' rely on the
     corresponding editor being available and being on the path. This
     is system-dependent.

_S_e_e _A_l_s_o:

     `edit.data.frame', `data.entry', `fix'.

_E_x_a_m_p_l_e_s:

     # use xedit on the function mean and assign the changes
     mean <- edit(mean, editor = "xedit")

     # use vi on mean and write the result to file mean.out
     vi(mean, file = "mean.out")

