diff --git a/.Rproj.user/178A6739/sources/prop/A1AE5A83 b/.Rproj.user/178A6739/sources/prop/A1AE5A83 index 366069c..690db24 100644 --- a/.Rproj.user/178A6739/sources/prop/A1AE5A83 +++ b/.Rproj.user/178A6739/sources/prop/A1AE5A83 @@ -1,6 +1,6 @@ { "source_window_id": "", "Source": "Source", - "cursorPosition": "291,28", - "scrollLine": "223" + "cursorPosition": "8,11", + "scrollLine": "0" } \ No newline at end of file diff --git a/.Rproj.user/178A6739/sources/session-99529da2/FE6BB309 b/.Rproj.user/178A6739/sources/session-99529da2/FE6BB309 index 5b677c0..6d6c248 100644 --- a/.Rproj.user/178A6739/sources/session-99529da2/FE6BB309 +++ b/.Rproj.user/178A6739/sources/session-99529da2/FE6BB309 @@ -12,15 +12,15 @@ "properties": { "source_window_id": "", "Source": "Source", - "cursorPosition": "291,28", - "scrollLine": "223" + "cursorPosition": "8,11", + "scrollLine": "0" }, "folds": "", - "lastKnownWriteTime": 1686049083, + "lastKnownWriteTime": 1686049765, "encoding": "UTF-8", "collab_server": "", "source_window": "", - "last_content_update": 1686049083340, + "last_content_update": 1686049765357, "read_only": false, "read_only_alternatives": [] } \ No newline at end of file diff --git a/.Rproj.user/178A6739/sources/session-99529da2/FE6BB309-contents b/.Rproj.user/178A6739/sources/session-99529da2/FE6BB309-contents index 8c768be..9f30b0c 100644 --- a/.Rproj.user/178A6739/sources/session-99529da2/FE6BB309-contents +++ b/.Rproj.user/178A6739/sources/session-99529da2/FE6BB309-contents @@ -22,8 +22,7 @@ options(shiny.reactlog = TRUE, appDir = getwd()) source("mod_basic.R") source("panel.R") - -# source("secretary.R") +source("secretary.R") # source("forplumber.R") source("modals.R") @@ -181,11 +180,7 @@ server <- function(input, output) { message("Error with IMF database. Please try again later.") } ) - - - - - + setProgress(value = 2, message = "Done") }) diff --git a/app.R b/app.R index 8c768be..9f30b0c 100644 --- a/app.R +++ b/app.R @@ -22,8 +22,7 @@ options(shiny.reactlog = TRUE, appDir = getwd()) source("mod_basic.R") source("panel.R") - -# source("secretary.R") +source("secretary.R") # source("forplumber.R") source("modals.R") @@ -181,11 +180,7 @@ server <- function(input, output) { message("Error with IMF database. Please try again later.") } ) - - - - - + setProgress(value = 2, message = "Done") }) diff --git a/secretary.R b/secretary.R new file mode 100644 index 0000000..be424e6 --- /dev/null +++ b/secretary.R @@ -0,0 +1,11 @@ +# Function to get mode +getmode <- function(v) { + uniqv <- unique(v) + uniqv[which.max(tabulate(match(v, uniqv)))] +} + +# Function to return length of unique + +lenun <- function(x) { + length(unique(x)) +} \ No newline at end of file