Skip to content

Commit

Permalink
mostly done
Browse files Browse the repository at this point in the history
  • Loading branch information
triphook committed Nov 2, 2023
1 parent 12bde1d commit ec172c3
Show file tree
Hide file tree
Showing 3 changed files with 14,661 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/mod_data_flagging.R
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ mod_data_flagging_server <- function(id, tadat) {
)

# Add flagging columns to raw table
tadat$raw <- applyFlags(tadat$raw, tadat$orgs)
# write.csv(tadat$raw, "flagged.csv")
# tadat$raw = utils::read.csv("flagged.csv") # THIS IS TRIPS WORKING FILE FOR TESTING, COMMENT OUT WHEN COMMITTING TO DEVELOP
#tadat$raw <- applyFlags(tadat$raw, tadat$orgs)
#write.csv(tadat$raw, "flagged.csv")
tadat$raw = utils::read.csv("flagged.csv") # THIS IS TRIPS WORKING FILE FOR TESTING, COMMENT OUT WHEN COMMITTING TO DEVELOP

# A table (raw rows, flags) indicating whether each record passes each test
values$testResults <- flagCensus(tadat$raw)
Expand Down
70 changes: 70 additions & 0 deletions R/utils_track_progress.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
tsf_prompts = c("Job id:", "Data source:", "Selected flags:", "Selected filters:")

trackEverything <- function(tadat, input) {
#print("Memory:")
#trackMemory(tadat, input)
#print("Input:")
#print(input)
#print("Switches: ")
#switch_vals = getFlags(input)
#print(switch_vals)
}

trackMemory <- function(tadat, input) {
print(" All: ")
print(ls())
print(input)
if (length(names(tadat)) > 0) {
print(" tadat:")
for (i in 1:length(names(tadat))) {
name <- names(tadat)[i]
size <- as.numeric(utils::object.size(tadat[[name]]))
print(paste0(" ", name, ": ", size))
}
}

}


writeFile <- function(tadat, filename) {
job_id <- paste0("ts", format(Sys.time(), "%y%m%d%H%M%S"))
flagSwitches <-
dataSource <- tadat$dataSource
dataSourceDesc <- tadat$dataSourceDesc
selected_flags <- tadat$selected_flags
selected_filters <- tadat$selected_filters
save(job_id,
dataSource,
dataSourceDesc,
selected_flags,
selected_filters,
file = filename)
}

readFile <- function(tadat, filename) {
load(filename, verbose = TRUE)

# Confirm compatibility
#job_id = job_id
#shinyjs::disable(selector = '.nav li a[data-value="Overview"]')

# Populate flags
if (!is.null(selected_flags)){
tadat$selected_flags = selected_flags
shinyjs::enable(selector = '.nav li a[data-value="Flag"]')
}

# Populate filters
if (!is.null(selected_filters)){
tadat$selected_filters = selected_filters
shinyjs::enable(selector = '.nav li a[data-value="Filter"]')
}

shinyjs::enable(selector = '.nav li a[data-value="Censored"]')
shinyjs::enable(selector = '.nav li a[data-value="Review"]')
}

invalidFile <- function(trigger){
print("EPIC FAIL")
print(trigger)
}
Loading

0 comments on commit ec172c3

Please sign in to comment.