Learn R Programming

phenology (version 4.0.4)

read_folder: Reads all files present in a folder and creates a list with the content of these files

Description

To create a list, the syntax is datalist<-read_folder(folder=".", read=read.delim, header=FALSE) Return NULL with a warning if the folder does not exist or is empty. The names of the elements of the list are the filenames.

Usage

read_folder(folder = try(file.choose(), silent = TRUE), wildcard = "*.*",
  read = read.delim, ...)

Arguments

folder
Where to search for files; can be or a file path or a folder path
wildcard
Define which files are to be read (examples: "*.*", "*.xls", "essai*.txt")
read
Function used to read file. Ex: read.delim or read.xls from gdata package
...
Parameters send to the read function

Value

  • Return a list of the data in the files of the folder (directory for windows users)

Details

read_folder reads all files present in a folder

Examples

Run this code
library(phenology)
# Read all the files from a folder/directory
Gratiot<-read_folder(".")

Run the code above in your browser using DataLab