fileBrowser            package:tkWidgets            R Documentation

_S_i_m_p_l_e _I_n_t_e_r_f_a_c_e _t_o _V_i_e_w _a_n_d _P_i_c_k _F_i_l_e_s

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

     This function provides the widget for users to go up and down a
     path and view the files.  When files are selected and the '"End"'
     button is pressed, the function returns a vector of character
     strings with the full paths of the selected files.

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

     fileBrowser(path="", testFun = function(x) TRUE, prefix = NULL,
                 suffix = NULL, textToShow = "Select file(s)",
                 nSelect = -1)

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

    path: character string for the full path to be view. Defaults to
          the current working directory if no path is provided.

 testFun: function that checks to see if a given file name satisfies
          predefined requirements. The default is no checking.

  prefix: character string for a prefix used to screen out file names
          that do not have that prefix as part of their names.

  suffix: character string for a suffix used to screen out file names
          that do not have that suffix as part of their names.

textToShow: character string to be shown on the widget to given
          instructions to users.

 nSelect: integer indicating the number of files that should be
          selected.  No limitation if 'nSelect = -1' as per default.

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

     When a path is viewed, files will be displayed as they are and
     directories will be displayed with a system file separator
     appended (e.g. '"/"' for Unix systems). Single click on a file
     name will make the file selectable when the select button is
     pressed.  Multiple selection is possible by dragging with mouse
     button 1 pressed. Double click on a directory name will go into
     that directory and display its files.  When a file/directory is
     selected and the "End" button pressed, the full path for the
     selected files selected will be returned.

     The widget is modal and has to be closed by pressing the "End"
     button before doing any other operations. Functions, prefix, and
     suffix can be specified.  Examples of validity functions are
     'hasPrefix' and 'hasSuffix'.

     The following is a list of the buttons and their associated
     behavior:

     '_U_p' Moves the directory whose content is to be displayed in the
          box for file names one level up along the directory tree.  No
          action if already on top of the tree.

     '_S_e_l_e_c_t >> ' When a file or files in the box for file names in a
          directory have been highlighted by clicking or dragging mouse
          button 1 and this button is pushed, the highlighted file(s)
          will be displayed in the box for selected file(s) on the
          right.

     '<< _R_e_m_o_v_e' When a file or files in the box for selected files
          have been highlighted by clicking or dragging this button is
          pushed, the highlighted file(s) will be removed from the box.

     '_C_l_e_a_r' Clears everything in the box for selected files when
          pushed.

     '_e_n_d' Returns a vector containing all the names in the box for
          selected files or 'NULL' if the box is empty.  The full path
          will be appended to the file names.

_V_a_l_u_e:

     A vector of character strings containing the full path of each
     file selected.

_N_o_t_e:

     This function is part of the Bioconductor project at Dana-Farber
     Cancer Institute to provide Bioinformatics functions using R.

_A_u_t_h_o_r(_s):

     Jianhua (John) Zhang

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

     'pickFiles', 'hasPrefix', 'hasSuffix'

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

     ## The example here is only run interactively since it requires user
     ## interference which may cause problems if not available:
     if(interactive()) {

       # Call the function to view the current directory
       flist <- fileBrowser()
       flist

       # To call the function with a path do
       # fileBrowser(path = "yourPath")
     }

