Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.Rproj.user
.Rhistory
.RData
.Ruserdata
13 changes: 13 additions & 0 deletions Biocomp_tutorial11.Rproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX
29 changes: 29 additions & 0 deletions Exercise9.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#Where x is a specified column in the files in dir
path=("~/Desktop/Dir")
DirFiles=list.files(path=path, pattern="*.csv")
for (i in 1:DirFiles) {
read.csv(i,header=TRUE,stringsAsFactors = FALSE, sep = ",")
}
varianceFunction<-function(dir,x){
CoefVector<-vector()
a=0
b=0
for (i in dir) {
if(i[,x]<50){
print("Warning! Less than 50 columns. If you wish to continue, type Yes")
if (readline()=="Yes"){
a<-mean(i[,x])
b<-sd(i[,x])
varianceCoef=b/a
append(CoefVector, varianceCoef, after=length(CoefVector))
}else{
break
}
}else{
a<-mean(i[,x])
b<-sd(i[,x])
varianceCoef=b/a
append(CoefVector, varianceCoef, after=length(CoefVector))
}
}
}