readIn: Batch read multiple csv files to list

Description Usage Arguments Details Value References Examples

Description

Read in all the files from a given directory and save each to a different element of a list.

Usage

1
  readIn(path, row.names = TRUE)

Arguments

path

The path of the directory containing the files to be read

row.names

Do the files to be read in have row names? Default is yes. If not, set this argument to FALSE.

Details

This function reads in all the files from a given directory and stores each as a separate element in a list. The names of the original files do not matter, but the function assumes all to be comma-delimited files with the row names stored in the first column and with each column having a name. Can modify this in the future if others find it useful.

Value

A list with each file stored as a separate element.

References

Miller, Trisos and Farine.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
#path <- "/Users/eliotmiller/Desktop/delete"

#test <- readIn(path)

#output <- matrix(0, nrow=19, ncol=3)

#for(i in 1:length(test))
#{
#	output <- output + test[[i]]
#}

#output <- t(output)

#ordr <- c("IAC","Haed","PD","PD_Cadotte","Hed","Eed","AW_MNTD","NAW_MNTD","PSC","PAE","Eaed","NAW_MPD","PSV","inter_MPD","PSE","intra_MPD","QE","complete_MPD","SimpsonsPhy")

#output <- output[,ordr]

#barplot(output, beside=TRUE, las=2, cex.names=0.7, col=c("red","gray","blue"), xlab="Metric", ylab="Count")

#legend(x=1, y=98, c("Type1","No signal","Good"), fill=c("red","gray","blue"))

eliotmiller/labAnalysis documentation built on May 16, 2019, 3:02 a.m.