diff --git a/Tutorial_9_answers.R b/Tutorial_9_answers.R new file mode 100644 index 0000000..0788d55 --- /dev/null +++ b/Tutorial_9_answers.R @@ -0,0 +1,31 @@ +#set working directory +setwd("~/Desktop/r-novice-inflammation/Biocomp_tutorial11/practice_dir") + +#this is my answer to this week's assignment + +cov_function <- function(dir, col, nrow=50){ + #dir should be a path + coV <- 0 + file_list <- list.files(dir) + for(i in file_list){ + table <- read.table(file= i, header=TRUE, sep=",", stringsAsFactors = FALSE) + num_rows <- length(table[,col]) + if(num_rows