pickFiles             package:tkWidgets             R Documentation

_P_i_c_k _E_l_e_m_e_n_t_s _F_r_o_m _V_e_c_t_o_r _o_f _S_t_r_i_n_g_s

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

     Takes a vector of strings and then checks to see if the predefined
     conditions are met for each element.  Elements that meet the
     conditions will be included in the vector returned and the others
     not.

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

     pickFiles(fileNames, fun = function(x) TRUE,
               prefix = NULL, suffix = NULL, exclude = .Platform$file.sep)

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

fileNames: vector of strings that will be checked.

     fun: function to be used to check the strings.  Default is no
          checking.

  prefix: character used to check to see if strings in the vector have
          the prefix.

  suffix: character used to check to see if strings in the vector have
          the suffix.

 exclude: character string with which strings in the vector will be
          excluded form the checking.  The default is to exclude all
          the directory names and always return them.

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

     The function fun will be used only when both prefix and suffix are
     NULL. If a prefix is not NULL, that prefix will be checked. A
     suffix is going to be checked when prefix is NULL.

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

     Character vector of file names satisfying the conditions.

_N_o_t_e:

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

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

     Jianhua Zhang

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

     'fileBrowser', 'hasPrefix', 'hasSuffix'

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

     # Return every thing from the current directory
     pickFiles(list.files())

     # Create a temp file
     file.create("myFile")

     # Returns subdirectory names and file names with a prefix of "my"
     pickFiles(list.files(), prefix = "my")

     # create another temp file
     file.create("temp.tex")

     # Return subdirectory names and file names with a suffix of ".tex"
     pickFiles(list.files(), suffix = ".tex")

     # clearn up
     unlink("myFile")
     unlink("temp.tex")

