# Generate code to read a file

Source: `R/radiant.R`
`read_files.Rd`

Generate code to read a file

    read_files(
      path,
      pdir = "",
      type = "rmd",
      to = "",
      clipboard = TRUE,
      radiant = FALSE
    )

## Arguments

path

  Path to file. If empty, a file browser will be opened

pdir

  Project dir

type

  Generate code for _Report > Rmd_ ("rmd") or _Report > R_ ("r")

to

  Name to use for object. If empty, will use file name to derive an object name

clipboard

  Return code to clipboard (not available on Linux)

radiant

  Should returned code be formatted for use with other code generated by Radiant?

## Details

Return code to read a file at the specified path. Will open a file browser if no path is provided

## Examples

    if (interactive()) {
      read_files(clipboard = FALSE)
    }