From fc74149f5f0295b24f47f26e33e06eb669180457 Mon Sep 17 00:00:00 2001 From: Edward Date: Thu, 9 May 2024 18:09:38 -0700 Subject: [PATCH] Update to the removal of some files in git history --- .Rproj.user/B1D2DF4B/pcs/files-pane.pper | 9 - .Rproj.user/B1D2DF4B/pcs/source-pane.pper | 3 - .../B1D2DF4B/pcs/windowlayoutstate.pper | 14 -- .Rproj.user/B1D2DF4B/pcs/workbench-pane.pper | 5 - .Rproj.user/B1D2DF4B/rmd-outputs | 5 - .Rproj.user/B1D2DF4B/saved_source_markers | 1 - .Rproj.user/B1D2DF4B/sources/prop/434EF46E | 6 - .Rproj.user/B1D2DF4B/sources/prop/INDEX | 1 - .../sources/session-5c2c7f91/8F1E7B59 | 26 --- .../session-5c2c7f91/8F1E7B59-contents | 157 ------------------ .../sources/session-5c2c7f91/lock_file | 0 .../shared/notebooks/patch-chunk-names | 0 12 files changed, 227 deletions(-) delete mode 100644 .Rproj.user/B1D2DF4B/pcs/files-pane.pper delete mode 100644 .Rproj.user/B1D2DF4B/pcs/source-pane.pper delete mode 100644 .Rproj.user/B1D2DF4B/pcs/windowlayoutstate.pper delete mode 100644 .Rproj.user/B1D2DF4B/pcs/workbench-pane.pper delete mode 100644 .Rproj.user/B1D2DF4B/rmd-outputs delete mode 100644 .Rproj.user/B1D2DF4B/saved_source_markers delete mode 100644 .Rproj.user/B1D2DF4B/sources/prop/434EF46E delete mode 100644 .Rproj.user/B1D2DF4B/sources/prop/INDEX delete mode 100644 .Rproj.user/B1D2DF4B/sources/session-5c2c7f91/8F1E7B59 delete mode 100644 .Rproj.user/B1D2DF4B/sources/session-5c2c7f91/8F1E7B59-contents delete mode 100644 .Rproj.user/B1D2DF4B/sources/session-5c2c7f91/lock_file delete mode 100644 .Rproj.user/shared/notebooks/patch-chunk-names diff --git a/.Rproj.user/B1D2DF4B/pcs/files-pane.pper b/.Rproj.user/B1D2DF4B/pcs/files-pane.pper deleted file mode 100644 index a72044a..0000000 --- a/.Rproj.user/B1D2DF4B/pcs/files-pane.pper +++ /dev/null @@ -1,9 +0,0 @@ -{ - "sortOrder": [ - { - "columnIndex": 2, - "ascending": true - } - ], - "path": "~/Developer/r-projects/shiny-projects/Weather/weather" -} \ No newline at end of file diff --git a/.Rproj.user/B1D2DF4B/pcs/source-pane.pper b/.Rproj.user/B1D2DF4B/pcs/source-pane.pper deleted file mode 100644 index 902cc6f..0000000 --- a/.Rproj.user/B1D2DF4B/pcs/source-pane.pper +++ /dev/null @@ -1,3 +0,0 @@ -{ - "activeTab": 0 -} \ No newline at end of file diff --git a/.Rproj.user/B1D2DF4B/pcs/windowlayoutstate.pper b/.Rproj.user/B1D2DF4B/pcs/windowlayoutstate.pper deleted file mode 100644 index 3ce28a1..0000000 --- a/.Rproj.user/B1D2DF4B/pcs/windowlayoutstate.pper +++ /dev/null @@ -1,14 +0,0 @@ -{ - "left": { - "splitterpos": 147, - "topwindowstate": "NORMAL", - "panelheight": 641, - "windowheight": 679 - }, - "right": { - "splitterpos": 407, - "topwindowstate": "NORMAL", - "panelheight": 641, - "windowheight": 679 - } -} \ No newline at end of file diff --git a/.Rproj.user/B1D2DF4B/pcs/workbench-pane.pper b/.Rproj.user/B1D2DF4B/pcs/workbench-pane.pper deleted file mode 100644 index 75e70e9..0000000 --- a/.Rproj.user/B1D2DF4B/pcs/workbench-pane.pper +++ /dev/null @@ -1,5 +0,0 @@ -{ - "TabSet1": 0, - "TabSet2": 0, - "TabZoom": {} -} \ No newline at end of file diff --git a/.Rproj.user/B1D2DF4B/rmd-outputs b/.Rproj.user/B1D2DF4B/rmd-outputs deleted file mode 100644 index 3f2ff2d..0000000 --- a/.Rproj.user/B1D2DF4B/rmd-outputs +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/.Rproj.user/B1D2DF4B/saved_source_markers b/.Rproj.user/B1D2DF4B/saved_source_markers deleted file mode 100644 index 2b1bef1..0000000 --- a/.Rproj.user/B1D2DF4B/saved_source_markers +++ /dev/null @@ -1 +0,0 @@ -{"active_set":"","sets":[]} \ No newline at end of file diff --git a/.Rproj.user/B1D2DF4B/sources/prop/434EF46E b/.Rproj.user/B1D2DF4B/sources/prop/434EF46E deleted file mode 100644 index ad25949..0000000 --- a/.Rproj.user/B1D2DF4B/sources/prop/434EF46E +++ /dev/null @@ -1,6 +0,0 @@ -{ - "source_window_id": "", - "Source": "Source", - "cursorPosition": "24,7", - "scrollLine": "11" -} \ No newline at end of file diff --git a/.Rproj.user/B1D2DF4B/sources/prop/INDEX b/.Rproj.user/B1D2DF4B/sources/prop/INDEX deleted file mode 100644 index 19de0c2..0000000 --- a/.Rproj.user/B1D2DF4B/sources/prop/INDEX +++ /dev/null @@ -1 +0,0 @@ -~%2FDeveloper%2Fr-projects%2Fshiny-projects%2FWeather%2Fweather%2Fapp.R="434EF46E" diff --git a/.Rproj.user/B1D2DF4B/sources/session-5c2c7f91/8F1E7B59 b/.Rproj.user/B1D2DF4B/sources/session-5c2c7f91/8F1E7B59 deleted file mode 100644 index 8f32d2a..0000000 --- a/.Rproj.user/B1D2DF4B/sources/session-5c2c7f91/8F1E7B59 +++ /dev/null @@ -1,26 +0,0 @@ -{ - "id": "8F1E7B59", - "path": "~/Developer/r-projects/shiny-projects/Weather/weather/app.R", - "project_path": "app.R", - "type": "r_source", - "hash": "0", - "contents": "", - "dirty": false, - "created": 1715299456214.0, - "source_on_save": false, - "relative_order": 1, - "properties": { - "source_window_id": "", - "Source": "Source", - "cursorPosition": "24,7", - "scrollLine": "11" - }, - "folds": "", - "lastKnownWriteTime": 1715208335, - "encoding": "UTF-8", - "collab_server": "", - "source_window": "", - "last_content_update": 1715208335, - "read_only": false, - "read_only_alternatives": [] -} \ No newline at end of file diff --git a/.Rproj.user/B1D2DF4B/sources/session-5c2c7f91/8F1E7B59-contents b/.Rproj.user/B1D2DF4B/sources/session-5c2c7f91/8F1E7B59-contents deleted file mode 100644 index cee71af..0000000 --- a/.Rproj.user/B1D2DF4B/sources/session-5c2c7f91/8F1E7B59-contents +++ /dev/null @@ -1,157 +0,0 @@ -library(shiny) -library(bslib) -library(httr) -library(jsonlite) -library(lubridate) - -ui <- fluidPage( - div(class = "intro", - titlePanel("Dashboard - Weather Reports"), - h4("Powered by ", - actionLink("website", "edwardcreates.ca", onclick = "window.open('https://www.edwardcreates.ca/', '_blank')")), - - ), - actionButton("refresh", "Refresh", - icon = icon("arrows-rotate")), - card( - div(class = "k-hstack", - layout_columns( - value_box( - title = "Current Temp", - value = "XX ˚C", - showcase = bsicons::bs_icon("calendar-event"), - theme = value_box_theme(bg = "#e6f2fd", fg = "#0B538E"), - class = "value_box" - ), - - value_box( - title = "Lowest Temperature", - value = textOutput("minTemp"), - showcase = bsicons::bs_icon("thermometer-low"), - theme = value_box_theme(bg = "#e6f2fd", fg = "#0B538E"), - class = "value_box" - ), - - value_box( - title = "Highest Temperature", - value = textOutput("maxTemp"), - showcase = bsicons::bs_icon("thermometer-high"), - theme = value_box_theme(bg = "#e6f2fd", fg = "#0B538E"), - class = "value_box" - ), - - value_box( - title = "Average Temperature", - value = textOutput("avgTemp"), - showcase = bsicons::bs_icon("calendar3"), - theme = value_box_theme(bg = "#e6f2fd", fg = "#0B538E"), - class = "value_box" - ), - ), - ), - tags$style( - " - .k-hstack { - margin-top: 1rem; - margin-bottom: 3rem; - } - .intro { - margin-bottom: 4rem; - } - .value_box { - width: 4/6; - } - " - ), - ), - card( - - plotOutput("apiPlot") - ), - card( - plotOutput("statPlot") - ) -) - -server <- function(input, output) { - observeEvent(input$refresh, { - # Refresh the entire page - session$reload() - }) - - # Must pull weather data from Vancouver - fetchData <- function() { - response <- GET("https://api.open-meteo.com/v1/forecast?latitude=49.2608724&longitude=-123.113952&hourly=temperature_2m&timeformat=unixtime&timezone=America%2FLos_Angeles&forecast_days=1") - - if (status_code(response) >= 200 && status_code(response) < 400) { - data <- fromJSON(content(response, "text")) - return(list( - time = data$hourly$time, - temp = data$hourly$temperature_2m - )) - } - - if (status_code(response) >= 400 && status_code(response) < 500) { - return("API Failed due to Human Error") - } - - if (status_code(response) >= 500 && status_code(response) < 600) { - return("API Failed due to Server Side Error\n\nPlease review the server...") - } - } - - # Min Temperature today - output$minTemp <- renderText({ - data <- fetchData() - paste(round(min(data$temp, na.rm = TRUE), digits = 2), "°C") - }) - - # Max Temperature today - output$maxTemp <- renderText({ - data <- fetchData() - paste(round(max(data$temp, na.rm = TRUE), digits = 2), "°C") - }) - - # Avg Temperature today - output$avgTemp <- renderText({ - data <- fetchData() - paste(round(mean(data$temp, na.rm = TRUE), digits = 2), "°C") - }) - - # Line Chart of Hourly Changes in Temperature - output$apiPlot <- renderPlot({ - data <- fetchData() - chartTitle = "Todays Temperature in Vancouver per Hour" - - # Convert Unix timestamp to R-readable timestamp - r_timestamp <- as.Date(as.POSIXct(as.numeric(data$time), origin = "1970-01-01")) - - # Used to show what the datetime info looks like before using the as.Date function - unconverted <- as.POSIXct(as.numeric(data$time), origin = "1970-01-01") - - # Isolates the Time from the Datetime - unconverted_hours <- format(unconverted, "%H:%M") - - - plot(unconverted, data$temp, type = "b", col = "#0B538E", xlab = "Hours in PST", ylab = "Temperature (°C)", main = chartTitle, - xlim = c(min(data$time), max(data$time))) - }) - - # Bar Chart of general Stats - output$statPlot <- renderPlot({ - data <- fetchData() - chartTitle = "Comparison of General Stats about Hourly Temps" - xaxis = c(min(data$temp, na.rm = TRUE), mean(data$temp, na.rm = TRUE), IQR(data$temp, na.rm = TRUE), max(data$temp, na.rm = TRUE)) - xLabels = c("Min Temp", "Average Temp", "IQR", "Max Temp") - - barplot(xaxis, - xlab = "Stats", - ylab = "Temperature ˚C", - names.arg = xLabels, - col = "#e6f2fd", - main = chartTitle - ) - }) -} - -shinyApp(ui = ui, server = server) diff --git a/.Rproj.user/B1D2DF4B/sources/session-5c2c7f91/lock_file b/.Rproj.user/B1D2DF4B/sources/session-5c2c7f91/lock_file deleted file mode 100644 index e69de29..0000000 diff --git a/.Rproj.user/shared/notebooks/patch-chunk-names b/.Rproj.user/shared/notebooks/patch-chunk-names deleted file mode 100644 index e69de29..0000000