From 909776ec85c27cc3b87e25be9354ad40abea3f72 Mon Sep 17 00:00:00 2001 From: selidris <92063773+selidris@users.noreply.github.com> Date: Thu, 18 Nov 2021 23:32:08 -0500 Subject: [PATCH] Add files via upload --- Assignment 9.R | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Assignment 9.R diff --git a/Assignment 9.R b/Assignment 9.R new file mode 100644 index 0000000..0bc266c --- /dev/null +++ b/Assignment 9.R @@ -0,0 +1,34 @@ +#Exercise 9 + +#Set working directory, create vector for coefficient of variation +setwd(dir) +files<-list.files(dir) +CoefVar<-function(dir, col, nrow=50){ +CoefVarVector<-numeric(0) + +#Loop files in directory to determine coefficient of variation +for (i in files){ + i<-read.csv(i, sep=",", header=TRUE, stringsAsFactors=FALSE, fill=TRUE) + if(ncol(i)