EVOLUTION-MANAGER
Edit File: tk_choose.files.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Choose a List of Files Interactively</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for tk_choose.files {tcltk}"><tr><td>tk_choose.files {tcltk}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Choose a List of Files Interactively</h2> <h3>Description</h3> <p>Use a Tk file dialog to choose a list of zero or more files interactively. </p> <h3>Usage</h3> <pre> tk_choose.files(default = "", caption = "Select files", multi = TRUE, filters = NULL, index = 1) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>default</code></td> <td> <p>which filename to show initially.</p> </td></tr> <tr valign="top"><td><code>caption</code></td> <td> <p>the caption on the file selection dialog.</p> </td></tr> <tr valign="top"><td><code>multi</code></td> <td> <p>whether to allow multiple files to be selected.</p> </td></tr> <tr valign="top"><td><code>filters</code></td> <td> <p>two-column character matrix of filename filters.</p> </td></tr> <tr valign="top"><td><code>index</code></td> <td> <p>unused.</p> </td></tr> </table> <h3>Details</h3> <p>Unlike <code><a href="../../base/html/file.choose.html">file.choose</a></code>, <code>tk_choose.files</code> will always attempt to return a character vector giving a list of files. If the user cancels the dialog, then zero files are returned, whereas <code><a href="../../base/html/file.choose.html">file.choose</a></code> would signal an error. </p> <p>The format of <code>filters</code> can be seen from the example. File patterns are specified via extensions, with <code>"*"</code> meaning any file, and <code>""</code> any file without an extension (a filename not containing a period). (Other forms may work on specific platforms.) Note that the way to have multiple extensions for one file type is to have multiple rows with the same name in the first column, and that whether the extensions are named in file chooser widget is platform-specific. <b>The format may change before release.</b> </p> <h3>Value</h3> <p>A character vector giving zero or more file paths. </p> <h3>Note</h3> <p>A bug in Tk 8.5.0–8.5.4 prevented multiple selections being used. </p> <h3>See Also</h3> <p><code><a href="../../base/html/file.choose.html">file.choose</a></code>, <code><a href="tk_choose.dir.html">tk_choose.dir</a></code> </p> <h3>Examples</h3> <pre> Filters <- matrix(c("R code", ".R", "R code", ".s", "Text", ".txt", "All files", "*"), 4, 2, byrow = TRUE) Filters if(interactive()) tk_choose.files(filter = Filters) </pre> <hr /><div style="text-align: center;">[Package <em>tcltk</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>