From dfaf51ec63574e483831672a275a18f632aa8359 Mon Sep 17 00:00:00 2001 From: Katherine Urasky Date: Wed, 17 Nov 2021 14:36:44 -0500 Subject: [PATCH] Turn in my homework --- Tutorial_9_answers.R | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Tutorial_9_answers.R 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