diff --git a/Exercise9.R b/Exercise9.R new file mode 100644 index 0000000..e6c0971 --- /dev/null +++ b/Exercise9.R @@ -0,0 +1,38 @@ +# Exercise 09 + +setwd("~/Desktop/Fall-2021/Biocomputing/Biocomp_tutorial11") +# Name of function and arguments + +# Takes a directory path and column number, default arguments are set for rows and override +exercise9 <- function(dir, column, rows=50, override=FALSE){ +# Reads data from each file in the specified directory + file_list <- list.files(path=dir) # This function assumes that all of the files in the directory are .csv files + results<-NA # Creates results vector + for(i in 1:length(file_list)){ + data <- read.table(file_list[i]) + if(nrow(data)