read.multi {metamicrobiomeR} | R Documentation |
Read multiple files
Description
This function reads multiple files of the same pattern in a directory into R.
Usage
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
# 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")
[Package metamicrobiomeR version 1.2 Index]