Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions MaronTutorial11.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#Tutorial Assignment 12
setwd("/Users/erinmaron/Desktop/r-novice-inflammation/BioComp/ClassWork/Biocomp_tutorial11")

#Calling Directory
dir<-function(directory,column){
files<-list.files(pattern="*.csv") #pulls list of files from directory
for(i in 1:length(files)){
data<-read.table(files[i]) #read files within directory
stdev<-sd(data$column==column, na.rm=FALSE) #find and set the standard deviation of data
mean<-mean(data$column==column) #repeat with the mean
}
if(nrow(files>=50)){
return((stdev/mean)*100) #if the data has 50 or more points, print an error
}else{
print("Warning:Less than 50 data point", cdev) #if there is insufficient data, print an error but continue to prvide output
}
}

#Keep getting error with calling a column name in arguement, but cannot seem to find what to fix after looking at notes and googling, so this is as far as I could get