-
Notifications
You must be signed in to change notification settings - Fork 68
Expand file tree
/
Copy pathscratch_code.R
More file actions
27 lines (25 loc) · 750 Bytes
/
scratch_code.R
File metadata and controls
27 lines (25 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
readings = rep(1, length(storeLength))
for (k in 1:length(id)){
k=5
position = id[k]
fileNum = sprintf("%03d", position)
fileName = paste(directory, fileNum, sep = "")
fileNameType = paste(fileName, ".csv", sep = "")
data <- read.csv(fileNameType)
#data <- as.vector(data)
xData = data[,x]
clData = na.omit(xData)
if (k == 1) {
for (d in 1:vLength[k]){
storeLength[d] = clData[d]
}
}
if (k >= 2) {
for (d in vLength[k-1]:vLength[k]){
storeLength[d] = clData[d]
}
}
}
meanPollutant = mean(storeLength)
return(meanPollutant)
}