read.multi: Read multiple files

Description Usage Arguments Value Examples

Description

This function reads multiple files of the same pattern in a directory into R.

Usage

1
2
3
4
5
6
7
read.multi(
  patht,
  patternt = ".txt",
  assignt = "no",
  study = NULL,
  tolower.colnames = TRUE
)

Arguments

patht

path to files.

patternt

pattern of files. Options are ".txt" or ".csv".

assignt

assign files. Default is "no".

study

name of the study. Default is NULL.

tolower.colnames

turn all column names to lower case. Default is TRUE.

Value

list of all data files in the path

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# The data used for this example are available
# in the "metamicrobiomeR" package version in Github.
# Download example data from the package github repo
#setwd("your directory") #put your working directory inside the quotation marks
download.file(url = "https://github.com/nhanhocu/metamicrobiomeR/archive/master.zip",
destfile = "metamicrobiomeR-master.zip")
# unzip the .zip file
unzip(zipfile = "metamicrobiomeR-master.zip")
patht<-paste(getwd(),
"metamicrobiomeR-master/inst/extdata/QIIME_outputs/Bangladesh/alpha_div_collated", sep="/")
alpha.ba<-read.multi(patht=patht,patternt=".txt", assignt="no",study="Bangladesh")

metamicrobiomeR documentation built on Nov. 9, 2020, 5:06 p.m.