]> git.angelumana.com Git - liftboard/.git/commitdiff
fix historical plots
authoribidyouadu <angel.d.umana@gmail.com>
Thu, 3 Feb 2022 00:14:30 +0000 (19:14 -0500)
committeribidyouadu <angel.d.umana@gmail.com>
Thu, 3 Feb 2022 00:14:30 +0000 (19:14 -0500)
19 files changed:
.Rhistory
.Rproj.user/688FCC69/pcs/files-pane.pper
.Rproj.user/688FCC69/pcs/source-pane.pper
.Rproj.user/688FCC69/pcs/windowlayoutstate.pper
.Rproj.user/688FCC69/sources/prop/6815E065
.Rproj.user/688FCC69/sources/prop/D4824927
.Rproj.user/688FCC69/sources/s-FA01BD99/5C556F75-contents [deleted file]
.Rproj.user/688FCC69/sources/s-FA01BD99/63C95A32-contents [deleted file]
.Rproj.user/688FCC69/sources/s-FA01BD99/A690A505 [deleted file]
.Rproj.user/688FCC69/sources/s-FA01BD99/A690A505-contents [deleted file]
.Rproj.user/688FCC69/sources/s-FA01BD99/BA0BC75E [deleted file]
.Rproj.user/688FCC69/sources/s-FA01BD99/BA0BC75E-contents [deleted file]
.Rproj.user/688FCC69/sources/s-FA01BD99/F11D91F6-contents [deleted file]
.Rproj.user/688FCC69/sources/s-FA01BD99/FEEDDA97 [deleted file]
.Rproj.user/688FCC69/sources/s-FA01BD99/FEEDDA97-contents [deleted file]
.Rproj.user/688FCC69/sources/s-FA01BD99/lock_file [deleted file]
.Rproj.user/shared/notebooks/paths
.gitignore
server.R

index eabc57caf46743962a12fbc1e93b6e707cdc9971..6d20a40bb97ebe007c5f93878300cfbdf96e1a1f 100644 (file)
--- a/.Rhistory
+++ b/.Rhistory
@@ -101,3 +101,8 @@ dir
 getwd()
 setwd('Documents/projects/liftboard/')
 rsconnect::deployApp()
+install.package('rsconnect')
+install.packages('rsconnect')
+rsconnect::setAccountInfo(name='ibidyouadu', token='71ED4FEDAF57251FDDD0C73B2F51A5D4', secret='3sFYCmMbFk+xEZKLP9EcEat+PVAzvK9Jm5fs8QqT')
+getwd()
+rsconnect::deployApp()
index 41544a4c4a3046e159d3f434397c0c6e06181d90..5c95cb6dca2662dfd320856e0d2638a45c5af84e 100644 (file)
@@ -5,5 +5,5 @@
             "ascending": true
         }
     ],
-    "path": "~/Documents/projects"
+    "path": "~/Documents/projects/liftboard"
 }
\ No newline at end of file
index ddca97d7a81cee67a5bfdbf3a928062dc82d1df9..a528f3b7b2488815ca855ebd4b56128c1ddc8a6f 100644 (file)
@@ -1,3 +1,3 @@
 {
-    "activeTab": 2
+    "activeTab": -1
 }
\ No newline at end of file
index 381ddd59d941989f18e9254324688054b2e7422f..e201520aa88fea319149c630e442b1a56e0bbd31 100644 (file)
@@ -1,7 +1,7 @@
 {
     "left": {
         "splitterpos": 338,
-        "topwindowstate": "NORMAL",
+        "topwindowstate": "HIDE",
         "panelheight": 809,
         "windowheight": 847
     },
index 578552249a4c49c1fd9bbfebccce3d44fb03da84..807138dc9cdac968e6b7cec086131df83aee8953 100644 (file)
@@ -1,6 +1,6 @@
 {
     "source_window_id": "",
     "Source": "Source",
-    "cursorPosition": "8,0",
-    "scrollLine": "0"
+    "cursorPosition": "31,49",
+    "scrollLine": "28"
 }
\ No newline at end of file
index 578552249a4c49c1fd9bbfebccce3d44fb03da84..95b7c893e79181252f56a5eb31090d3f9ac1319a 100644 (file)
@@ -1,6 +1,6 @@
 {
     "source_window_id": "",
     "Source": "Source",
-    "cursorPosition": "8,0",
-    "scrollLine": "0"
+    "cursorPosition": "85,28",
+    "scrollLine": "77"
 }
\ No newline at end of file
diff --git a/.Rproj.user/688FCC69/sources/s-FA01BD99/5C556F75-contents b/.Rproj.user/688FCC69/sources/s-FA01BD99/5C556F75-contents
deleted file mode 100644 (file)
index 2ecad0f..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-x <- 2
-if (x == 3) {
-  print("is 3!")
-} else if (x == 2 | x < 0) {
-  print("is 2!")
-} else if (x > 0) {
-  print('is greater than 0!')
-} else {
-  print('dfsdfs')
-}
-
diff --git a/.Rproj.user/688FCC69/sources/s-FA01BD99/63C95A32-contents b/.Rproj.user/688FCC69/sources/s-FA01BD99/63C95A32-contents
deleted file mode 100644 (file)
index 2129631..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-library/
-local/
-lock/
-python/
-staging/
diff --git a/.Rproj.user/688FCC69/sources/s-FA01BD99/A690A505 b/.Rproj.user/688FCC69/sources/s-FA01BD99/A690A505
deleted file mode 100644 (file)
index e18e44c..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-{
-    "id": "A690A505",
-    "path": "~/Documents/projects/liftboard/ui.R",
-    "project_path": "ui.R",
-    "type": "r_source",
-    "hash": "0",
-    "contents": "",
-    "dirty": false,
-    "created": 1618861938496.0,
-    "source_on_save": false,
-    "relative_order": 1,
-    "properties": {
-        "source_window_id": "",
-        "Source": "Source",
-        "cursorPosition": "8,0",
-        "scrollLine": "0"
-    },
-    "folds": "",
-    "lastKnownWriteTime": 1619130953,
-    "encoding": "UTF-8",
-    "collab_server": "",
-    "source_window": "",
-    "last_content_update": 1619130953550,
-    "read_only": false,
-    "read_only_alternatives": []
-}
\ No newline at end of file
diff --git a/.Rproj.user/688FCC69/sources/s-FA01BD99/A690A505-contents b/.Rproj.user/688FCC69/sources/s-FA01BD99/A690A505-contents
deleted file mode 100644 (file)
index 3d4f7ae..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# This is the user-interface definition of a Shiny web application. You can
-# run the application by clicking 'Run App' above.
-#
-# Find out more about building applications with Shiny here:
-#
-#    http://shiny.rstudio.com/
-#
-
-
-
-# Define UI for application that draws a histogram
-shinyUI(fluidPage(
-
-    # Application title
-    titlePanel("Lifts data"),
-
-    # Sidebar with a slider input for number of bins
-    sidebarLayout(
-            sidebarPanel(
-                conditionalPanel(condition = "input.tabs == 'Exercises' |
-                                            input.tabs == 'Workout History'",
-                    selectInput(inputId = "muscles",
-                                label = "Muscle Group",
-                                choices = lifts$Category %>%
-                                            unique() %>%
-                                            sort())),
-                radioButtons(inputId = "metric",
-                             label = "Data to display",
-                             choices = c("Reps",
-                                         "Sets",
-                                         "Weight"))),
-
-        # Show a plot of the generated distribution
-        mainPanel(
-            tabsetPanel(type = "tabs", id = "tabs",
-                tabPanel(title = "Exercises",
-                    # conditionalPanel(condition = "input.metric == 'Reps' | input.metric == 'Weight'",
-                    plotOutput(outputId = 'exercises_plot')),
-                    # conditionalPanel(condition = "input.metric == 'Sets'"),
-                    #     plotOutput(outputId = 'exercises_sets_plot')),
-                tabPanel(title = "Muscles Breakdown",
-                    plotOutput(outputId = 'muscles_plot',
-                               height = "500px", width = "500px")),
-                tabPanel(title = "Workout History",
-                         plotOutput(outputId = "history_plot")))))
-))
diff --git a/.Rproj.user/688FCC69/sources/s-FA01BD99/BA0BC75E b/.Rproj.user/688FCC69/sources/s-FA01BD99/BA0BC75E
deleted file mode 100644 (file)
index 912a68a..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-{
-    "id": "BA0BC75E",
-    "path": "~/Documents/projects/liftboard/server.R",
-    "project_path": "server.R",
-    "type": "r_source",
-    "hash": "3533336264",
-    "contents": "",
-    "dirty": false,
-    "created": 1618861937261.0,
-    "source_on_save": false,
-    "relative_order": 2,
-    "properties": {
-        "source_window_id": "",
-        "Source": "Source",
-        "cursorPosition": "8,0",
-        "scrollLine": "0"
-    },
-    "folds": "",
-    "lastKnownWriteTime": 1626331698,
-    "encoding": "UTF-8",
-    "collab_server": "",
-    "source_window": "",
-    "last_content_update": 1626331698463,
-    "read_only": false,
-    "read_only_alternatives": []
-}
\ No newline at end of file
diff --git a/.Rproj.user/688FCC69/sources/s-FA01BD99/BA0BC75E-contents b/.Rproj.user/688FCC69/sources/s-FA01BD99/BA0BC75E-contents
deleted file mode 100644 (file)
index 79b14df..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-#
-# This is the server logic of a Shiny web application. You can run the
-# application by clicking 'Run App' above.
-#
-# Find out more about building applications with Shiny here:
-#
-#    http://shiny.rstudio.com/
-#
-
-# Define server logic required to draw a histogram
-shinyServer(function(input, output) {
-
-    selectedData <- reactive({
-        filter(lifts, Category == input$muscles)})
-    
-    setsData <- reactive({
-        selectedData() %>%
-            group_by(Exercise) %>%
-            count(name='Sets')})
-    
-    output$exercises_plot <- renderPlot({
-        if (input$metric == 'Sets') {
-            ggplot(data = setsData()) +
-                geom_bar(mapping = aes(x=Exercise, weight=Sets),
-                         fill = '#00aaaa',
-                         color = 'black') +
-                ylab('Sets')
-        } else {
-        ggplot(data = selectedData()) +
-            geom_bar(mapping = aes(x=Exercise, weight=!!sym(input$metric)),
-                     fill = '#00aaaa',
-                     color = 'black') +
-            ylab(input$metric)
-        }})
-    
-    sumBreakdown <- reactive({
-        if(input$metric == 'Sets') {
-            lifts %>%
-                group_by(Category) %>%
-                count(name = 'Sets') %>%
-                pivot_wider(names_from = Category, values_from = Sets)
-        } else {
-            lifts %>%
-                group_by(Category) %>%
-                summarize(Metric = sum(!!sym(input$metric))) %>%
-                pivot_wider(names_from = Category, values_from = Metric)
-        }})
-
-    step_size <- reactive({
-        if (input$metric == 'Sets') {
-            8
-        } else if (input$metric == 'Reps') {
-            35
-        } else {
-            1000
-        }})
-    maxval <- reactive({
-        step_size()*((max(sumBreakdown()) %/% step_size()) + 1)})
-
-    radarData <- reactive({
-        rbind(rep(maxval(),6), rep(0, 6), sumBreakdown())})
-    
-    output$muscles_plot <- renderPlot({
-        radarchart(radarData(), axistype = 1,
-                   pcol = rgb(0.2, 0.5, 0.5, 1),
-                   pfcol = rgb(0.2, 0.5, 0.5, 0.5),
-                   plwd = 2,
-                   cglcol = 'grey',
-                   cglty = 1,
-                   axislabcol = 'black',
-                   caxislabels = seq(0,maxval(),step_size()),
-                   cglwd = 1,
-                   vlcex = 1)})
-    
-    historyData <- reactive({
-        if (input$metric == 'Sets') {
-            lifts %>%
-                filter(Category == input$muscles) %>%
-                group_by(Date) %>%
-                count(name = 'Sets')
-        } else {
-            lifts %>%
-                filter(Category == input$muscles) %>%
-                group_by(Date) %>%
-                summarize(Metric = sum(!!sym(input$metric)))}})
-    
-    output$history_plot <- renderPlot({
-        ggplot(data = historyData(), mapping = aes(x=Date, y=!!sym(input$metric))) +
-            geom_line() +
-            geom_point()
-    })
-})
-
-## todo: figure out how to pass a variable into geom_bar....
\ No newline at end of file
diff --git a/.Rproj.user/688FCC69/sources/s-FA01BD99/F11D91F6-contents b/.Rproj.user/688FCC69/sources/s-FA01BD99/F11D91F6-contents
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/.Rproj.user/688FCC69/sources/s-FA01BD99/FEEDDA97 b/.Rproj.user/688FCC69/sources/s-FA01BD99/FEEDDA97
deleted file mode 100644 (file)
index 11cf3d4..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-{
-    "id": "FEEDDA97",
-    "path": "~/Documents/projects/liftboard/global.R",
-    "project_path": "global.R",
-    "type": "r_source",
-    "hash": "0",
-    "contents": "",
-    "dirty": false,
-    "created": 1618888022407.0,
-    "source_on_save": false,
-    "relative_order": 3,
-    "properties": {
-        "tempName": "Untitled1",
-        "source_window_id": "",
-        "Source": "Source",
-        "cursorPosition": "12,56",
-        "scrollLine": "0"
-    },
-    "folds": "",
-    "lastKnownWriteTime": 1620281651,
-    "encoding": "UTF-8",
-    "collab_server": "",
-    "source_window": "",
-    "last_content_update": 1620281651378,
-    "read_only": false,
-    "read_only_alternatives": []
-}
\ No newline at end of file
diff --git a/.Rproj.user/688FCC69/sources/s-FA01BD99/FEEDDA97-contents b/.Rproj.user/688FCC69/sources/s-FA01BD99/FEEDDA97-contents
deleted file mode 100644 (file)
index 83e39f0..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-library(shiny)
-library(ggplot2)
-library(dplyr)
-library(tidyr)
-library(readr)
-library(fmsb)
-
-lifts <- read_csv('data/lifts.csv')
-lifts <- rename(lifts, Weight = `Weight (lbs)`)
-muscles <- c('Back', 'Biceps', 'Chest', 'Legs', 'Shoulders', 'Triceps')
-lifts <- lifts %>%
-          filter(Category %in% muscles) %>%
-          select(Date, Exercise, Category, Weight, Reps)
\ No newline at end of file
diff --git a/.Rproj.user/688FCC69/sources/s-FA01BD99/lock_file b/.Rproj.user/688FCC69/sources/s-FA01BD99/lock_file
deleted file mode 100644 (file)
index e69de29..0000000
index 3b76b96d6d7aef9aa4dfb822657d587d4e568ad9..0db4e9426b92b29f814ca9bd1ebd48f988dd6ed9 100644 (file)
@@ -1,4 +1,5 @@
 /Users/adu/Documents/projects/liftboard/data/lifts.csv="C078BA41"
 /Users/adu/Documents/projects/liftboard/global.R="DE15BE1B"
 /Users/adu/Documents/projects/liftboard/renv/.gitignore="3CFF03A3"
-/Users/adu/Documents/projects/liftboard/testy.R="5D9D56E0"
+/Users/adu/Documents/projects/liftboard/server.R="23D01622"
+/Users/adu/Documents/projects/liftboard/ui.R="ACFB268D"
index e43b0f988953ae3a84b00331d0ccf5f7d51cb3cf..3ecd7f32a6fabaa02c5d858dcd94667cf61b02a7 100644 (file)
@@ -1 +1,2 @@
 .DS_Store
+.Rproj.user
index 79b14df1b577f6a2d3c0caa1a43efb57be8efbc0..6dcacbd286ca3621f3172874909d3aab312f7447 100644 (file)
--- a/server.R
+++ b/server.R
@@ -83,7 +83,9 @@ shinyServer(function(input, output) {
             lifts %>%
                 filter(Category == input$muscles) %>%
                 group_by(Date) %>%
-                summarize(Metric = sum(!!sym(input$metric)))}})
+                summarize(!!sym(input$metric) := sum(!!sym(input$metric)))
+        }
+    })
     
     output$history_plot <- renderPlot({
         ggplot(data = historyData(), mapping = aes(x=Date, y=!!sym(input$metric))) +