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()
"ascending": true
}
],
- "path": "~/Documents/projects"
+ "path": "~/Documents/projects/liftboard"
}
\ No newline at end of file
{
- "activeTab": 2
+ "activeTab": -1
}
\ No newline at end of file
{
"left": {
"splitterpos": 338,
- "topwindowstate": "NORMAL",
+ "topwindowstate": "HIDE",
"panelheight": 809,
"windowheight": 847
},
{
"source_window_id": "",
"Source": "Source",
- "cursorPosition": "8,0",
- "scrollLine": "0"
+ "cursorPosition": "31,49",
+ "scrollLine": "28"
}
\ No newline at end of file
{
"source_window_id": "",
"Source": "Source",
- "cursorPosition": "8,0",
- "scrollLine": "0"
+ "cursorPosition": "85,28",
+ "scrollLine": "77"
}
\ No newline at end of file
+++ /dev/null
-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')
-}
-
+++ /dev/null
-library/
-local/
-lock/
-python/
-staging/
+++ /dev/null
-{
- "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
+++ /dev/null
-#
-# 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")))))
-))
+++ /dev/null
-{
- "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
+++ /dev/null
-#
-# 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
+++ /dev/null
-{
- "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
+++ /dev/null
-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
/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"
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))) +