Description Usage Arguments Value Examples
View source: R/read_dir_csv_2.R
Suggest use lbr::read_dir_csv()
instead.
1 2 3 4 5 6 7 8 | read_dir_csv_2(
dir_path = NULL,
...,
file_pattern = "\\.csv$",
strict_csv_ext = T,
recursive = F,
snake_case = F
)
|
dir_path |
Path to desired directory. If |
... |
Argument to pass to |
file_pattern |
Regular expression to read from file name, default = "\.csv$" |
strict_csv_ext |
If |
recursive |
If |
snake_case |
If |
A list of tibbles
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # Not run
if(FALSE){
# Read form current working directory by default
read_dir_csv_2()
# And file names are set to names of each data frame in a list
# Give a directory path
read_dir_csv_2("path/to/dir")
# Also, can read from every sub-directory of given directory
read_dir_csv_2("path/to/dir", recursive = T)
# Can specify regular expression of file names to read
read_dir_csv_2(file_pattern = "[:digit:]+\\.csv$") # file name contains numbers
# If set strict_csv_ext = F and remove regex which require file name ending with .csv
# it might read other file type as well (if you like)
read_dir_csv_2(file_pattern = "[:digit:]+", strict_csv_ext = F)
# If you want file names in snake_case (require snakecase package)
read_dir_csv_2(snake_case = T)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.