-
Notifications
You must be signed in to change notification settings - Fork 0
/
OCAT - Combined - PA.r
47 lines (36 loc) · 1.18 KB
/
OCAT - Combined - PA.r
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# this script is to collect all of the CSVs into one CSV
library(readr)
game = "!GAME!"
COMPRESS = TRUE
setwd("!PATH!")
OCATcomb = data.frame(matrix(ncol = 24, nrow = 0))
listLOC = c(
!LOC!
)
READ = function(fold="", CSV, GPU, Quality = "", API="") {
if (API != "") API = paste0(API, "/")
if (length(listLOC[1]) == 0) listLOC = paste0("Recording ", 1:length(CSV))
len = min(length(listLOC), length(CSV))
out = data.frame(matrix(ncol = 24, nrow = 0))
for (place in 1:len) {
if (CSV[place] != ".csv") {
fileLOC = paste0(fold, GPU, "/" , Quality, "/", CSV[place])
if (API != "") fileLOC = paste0(fold, GPU, "/" , API, Quality, "/", CSV[place])
if (grepl(GPU, getwd()) & grepl(Quality, getwd())) fileLOC = paste0(CSV[place])
if (grepl(GPU, getwd()) & !grepl(Quality, getwd())) fileLOC = paste0(fold, API, Quality, "/",CSV[place])
} else {next}
OCATtemp = read_csv(fileLOC)[, 1:20]
OCATtemp$GPU = GPU
OCATtemp$Quality = Quality
OCATtemp$Location = listLOC[place]
OCATtemp$API = gsub("/", "", API)
out = rbind(out, OCATtemp)
}
return(out)
}
!LONG!
if (COMPRESS) {
write_csv(OCATcomb, "@Combined - !QUA!.csv.bz2")
} else {
write_csv(OCATcomb, "@Combined - !QUA!.csv")
}