R for
Authoring!!

OOH Session #55…
polling via R: Survey Launch

Open Office Hours
(December 10, 2024)

  • Recap session #54       ↔︎️
  • Focal issue(s):
    • polling via : Part V
  • Shared problem-solving

Recap of Session
#53:

Polling via Surveydown – Part IV…

# remotes::install_github("surveydown-dev/surveydown", force = TRUE)
library(surveydown)

# Database setup

# surveydown stores data on a database that you define at https://supabase.com/
# To connect to a database, update the sd_database() function with details
# from your supabase database. For this demo, we set ignore = TRUE, which will
# ignore the settings and won't attempt to connect to the database. This is
# helpful for local testing if you don't want to record testing data in the
# database table. See the documentation for details:
# https://surveydown.org/store-data

db <- sd_database(
  host   = "aws-0-us-west-1.pooler.supabase.com",
  dbname = "postgres",
  port   = "6543",
  user   = "postgres.yppmohklyshsiwkpadqa",
  table  = "Woody",
#  ignore = TRUE
)


# Server setup
server <- function(input, output, session) {

  # Define any conditional skip logic here (skip to page if a condition is true)
  sd_skip_if()

  # Define any conditional display logic here (show a question if a condition is true)
  sd_show_if()

  # Database designation and other settings
  sd_server(
    db = db
  )

}

# shinyApp() initiates your app - don't change it
shiny::shinyApp(ui = sd_ui(), server = server)




# viola
1
copy-paste from Supabase “Connection parameters” (see previous tab).
2
Supabase has a “Table Editor” identifier. The name you choose here will appear on the Supabase site.
3
Allows the survey to be launched without connecting to the database. If responses are provided, they will be stored within a local preview_data.csv file (within your project directory).

Today…

surveydown Part V – Survey Launch:

Session Info (December 10, 2024) Rendering:

R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.utf8 
[2] LC_CTYPE=English_United States.utf8   
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.utf8    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] fontawesome_0.5.2

loaded via a namespace (and not attached):
 [1] lubridate_1.9.3   emo_0.0.0.9000    digest_0.6.31     crayon_1.5.2     
 [5] assertthat_0.2.1  lifecycle_1.0.4   jsonlite_1.8.9    magrittr_2.0.3   
 [9] evaluate_1.0.0    stringi_1.7.12    rlang_1.1.3       cli_3.6.0        
[13] rstudioapi_0.15.0 vctrs_0.6.5       generics_0.1.3    rmarkdown_2.28   
[17] tools_4.2.2       stringr_1.5.1     glue_1.6.2        purrr_1.0.1      
[21] xfun_0.42         yaml_2.3.10       fastmap_1.1.1     compiler_4.2.2   
[25] timechange_0.3.0  htmltools_0.5.7   knitr_1.45