Simon Smart's Avatar

Simon Smart

@simonsmart.bsky.social

✨ Shiny app developer at University of Leicester with @statsforbios πŸ₯” Former spudologist. 🌱 Grows plants 🚲 Rides bikes 🍺 Brews beer 🌐 https://github.com/simon-smart88

83 Followers  |  180 Following  |  54 Posts  |  Joined: 07.10.2024  |  2.5675

Latest posts by simonsmart.bsky.social on Bluesky

What I don't understand about this approach is how you detect when an API breaks / changes etc? Surely you want to know that your functions are broken and need updating?

01.08.2025 09:46 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

There's an archived version at archive.ph/v4CbC the kinds of domains used for these "news" articles are classic examples of the the type used by reputation management companies.

31.07.2025 14:23 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Disaggregation regression produces high resolution predictions from data aggregated into polygons making it well suited to epidemiological modelling. Disagapp makes the process simple and easy! 

Join Simon Smart and Tim Lucas for this introductory workshop.

On Teams 14:00-16:00 UTC  16 September 2025 

See more details and sign up via the QR code

Disaggregation regression produces high resolution predictions from data aggregated into polygons making it well suited to epidemiological modelling. Disagapp makes the process simple and easy! Join Simon Smart and Tim Lucas for this introductory workshop. On Teams 14:00-16:00 UTC 16 September 2025 See more details and sign up via the QR code

Myself and @statsforbios.bsky.social are running a workshop in September to introduce Disagapp disagapp.le.ac.uk for disaggregation regression. More details and sign up at forms.office.com/e/pjfbD6RvTi #rstats #episky #AcademicSky

21.07.2025 13:47 β€” πŸ‘ 7    πŸ” 3    πŸ’¬ 0    πŸ“Œ 0

My colleague informs me that Ctrl + space does the same thing too

21.07.2025 11:26 β€” πŸ‘ 2    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0

For anyone else wondering - you need to press tab after starting to type. So much pain caused by not knowing this til now!

21.07.2025 09:48 β€” πŸ‘ 3    πŸ” 2    πŸ’¬ 2    πŸ“Œ 0

Presumably you're using ExtendedTask? So long as you have >=3 workers (one for the app, one for each task) I can't see why what you describe would stop responsiveness and the UI layout shouldn't make a difference. Have you got a MRE?

16.07.2025 17:39 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Preview
PDF Export | reveal.js

revealjs.com/pdf-export/ ?

28.06.2025 07:12 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

I've got a copy. Can't DM you though

18.06.2025 13:37 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
πŸš€ Today, we’re announcing a big milestone for Soil Benchmark ✨ 10% of… | Tom Scrope | 39 comments πŸš€ Today, we’re announcing a big milestone for Soil Benchmark ✨ 10% of English farmland now uses our platform ✨ πŸŽ‰ To celebrate, we’re offering 10% off all week. It's free to get started and a...

Pretty cool that 10 % of UK farmland is now being managed with an #rstats #rshiny app www.linkedin.com/posts/tomscr... #iykyk

11.06.2025 14:02 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Not really - I don't think you have anything to fear. PAN's modus operandi is to test things, find tiny traces and generate a scary headline. Per the report, the exposure was 40000 times lower than a safe level. French regulators concluded exposure wasn't dangerous www.anses.fr/en/system/fi...

28.05.2025 11:05 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Organic panty liners recalled after traces of weedkiller found More than 3,000 boxes of Organyc-brand panty liners pulled in France and Canada after glyphosate detected in range of hygiene products

Previously, organic brands have also been found to contain glyphosate www.theguardian.com/world/2016/f... figures are different but those concentrations are actually higher than what the single detection in this report (0.025 vs 0.004 mg/kg)

28.05.2025 10:08 β€” πŸ‘ 0    πŸ” 1    πŸ’¬ 1    πŸ“Œ 0

Because there is an evidence-based system for determining safe MRLs and this is 40000 times lower than what a French regulator deems safe. Also by comparison, wheat can safely contain levels 1000 times higher than what was found.

28.05.2025 10:00 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Wow - this is an incredibly misleading piece of reporting that unquestionably parrots activist. Looking at their report, they found glyphosate in only 1/15 tampons tested and the exposure from that is still 40000 times lower than a level deemed safe by French regulators.

28.05.2025 09:55 β€” πŸ‘ 7    πŸ” 0    πŸ’¬ 0    πŸ“Œ 1
Preview
Dariia Mykhailyshyna - Workshops for Ukraine Feedback on the past workshops (if you want to learn how to make wordclouds, check out Text Data Analysis workshop below)

Shinyscholar 0.4.1 is up on CRAN. The UI has been migrated to {bslib} along with other tweaks to modernise it. Async tasks now run using {mirai}. Want to learn more? Then come along to the Workshop for Ukraine in a few weeks : sites.google.com/view/dariia-... #rstats

19.05.2025 11:59 β€” πŸ‘ 2    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0

And I think the solution in your case when the binary isn't yet available is to use install.packages("modelbased", type = "source")

02.05.2025 17:10 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Preview
modelbased: Estimation of Model-Based Predictions, Contrasts and Means Implements a general interface for model-based estimations for a wide variety of models, used in the computation of marginal means, contrast analysis and predictions. For a list of supported models, s...

The .tgz is the binary version which takes a while for CRAN to produce once a new version is uploaded. 0.11 is listed now on cran.r-project.org/web/packages... but you'll see the windows binaries are still 0.10

02.05.2025 17:07 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Preview
Dariia Mykhailyshyna - Workshops for Ukraine Feedback on the past workshops (if you want to learn how to make wordclouds, check out Text Data Analysis workshop below)

I'm delivering a Workshop for Ukraine on 5 June about {shinyscholar} cran.r-project.org/web/packages... a template for creating reproducible shiny apps for complex analyses in #rstats . More info and sign up here: sites.google.com/view/dariia-...

02.05.2025 09:37 β€” πŸ‘ 5    πŸ” 6    πŸ’¬ 0    πŸ“Œ 1
library(shiny)
library(bslib)
library(mirai)

daemons(1)
onStop(function() daemons(0))

ui <- page_fluid(
  p("The time is ", textOutput("current_time", inline = TRUE)),
  hr(),
  numericInput("n", "Sample size (n)", 100),
  numericInput("delay", "Seconds to take for plot", 5),
  actionButton("btn", "Go"),
  textOutput("progress_log"),
  plotOutput("plot"),
)

my_func <- function(x, y, file){
  writeLines(paste0("Starting..."), file)
  for (i in 1:y){
    Sys.sleep(1)
    writeLines(paste0("Step ", i, " complete"), file)
  }
  writeLines(paste0("Finished"), file)
  runif(x)
}

server <- function(input, output, session) {

  progress_file <- tempfile()

  output$current_time <- renderText({
    invalidateLater(1000)
    format(Sys.time(), "%H:%M:%S %p")
  })

  task_var <- NULL
  task <- ExtendedTask$new(
    function(...) task_var <<- mirai(run(...), environment(), .args = list(run = my_func))
  )

  observeEvent(input$btn, {
    if (task$status() == "running"){
      mirai::stop_mirai(task_var)
    }
    task$invoke(input$n, input$delay, progress_file)}
  )

  output$plot <- renderPlot({
    if (task$status() == "success"){
      hist(task$result())
    }
  })

  progress_reader <- reactiveFileReader(100, session, progress_file,
                                        readFunc = function(file) {
                                          if (file.exists(file)) {
                                            readLines(file)
                                          }
                                        }
  )

  output$progress_log <- renderPrint({
    cat(paste(progress_reader(), collapse = "\n"))
  })

}

shinyApp(ui = ui, server = server)

library(shiny) library(bslib) library(mirai) daemons(1) onStop(function() daemons(0)) ui <- page_fluid( p("The time is ", textOutput("current_time", inline = TRUE)), hr(), numericInput("n", "Sample size (n)", 100), numericInput("delay", "Seconds to take for plot", 5), actionButton("btn", "Go"), textOutput("progress_log"), plotOutput("plot"), ) my_func <- function(x, y, file){ writeLines(paste0("Starting..."), file) for (i in 1:y){ Sys.sleep(1) writeLines(paste0("Step ", i, " complete"), file) } writeLines(paste0("Finished"), file) runif(x) } server <- function(input, output, session) { progress_file <- tempfile() output$current_time <- renderText({ invalidateLater(1000) format(Sys.time(), "%H:%M:%S %p") }) task_var <- NULL task <- ExtendedTask$new( function(...) task_var <<- mirai(run(...), environment(), .args = list(run = my_func)) ) observeEvent(input$btn, { if (task$status() == "running"){ mirai::stop_mirai(task_var) } task$invoke(input$n, input$delay, progress_file)} ) output$plot <- renderPlot({ if (task$status() == "success"){ hist(task$result()) } }) progress_reader <- reactiveFileReader(100, session, progress_file, readFunc = function(file) { if (file.exists(file)) { readLines(file) } } ) output$progress_log <- renderPrint({ cat(paste(progress_reader(), collapse = "\n")) }) } shinyApp(ui = ui, server = server)

Being able to cancel and restart slow-running jobs in shiny with {mirai} is a bit of a game-changer #rstats Full app in alt text / gist.github.com/simon-smart8... with a method for updating progress too

29.04.2025 15:13 β€” πŸ‘ 12    πŸ” 5    πŸ’¬ 2    πŸ“Œ 0

See bsky.app/profile/simo...

17.04.2025 07:28 β€” πŸ‘ 2    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0

Not very elegant, but what about a script that generates an .rmd/.qmd with the right number of chunks?

30.03.2025 11:10 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Sounds good, but it's not really reducing emissions if the cashback comes from offsetting is it?

25.03.2025 15:20 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Agreed, but here you go: archive.ph/5iEDt and you can bookmark this link: javascript:void(open('http://archive.today/?run=1&url='+encodeURIComponent(document.location))) and if you click it when you're on a paywalled article it will load the archived version

18.03.2025 12:08 β€” πŸ‘ 2    πŸ” 1    πŸ’¬ 2    πŸ“Œ 0

Any chance you could share the code for making those plots?

06.03.2025 13:42 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

You definitely need some icing sugar! I'm all about savoury fillings to maximise the opportunities. Mushroom, cavolo nero, cream and cheese today

04.03.2025 19:42 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Chapter 12 Tidy evaluation | Mastering Shiny If you are using Shiny with the tidyverse, you will almost certainly encounter the challenge of programming with tidy evaluation. Tidy evaluation is used throughout the tidyverse to make...

Take a look at this chapter of mastering shiny: mastering-shiny.org/action-tidy....

28.02.2025 16:34 β€” πŸ‘ 7    πŸ” 2    πŸ’¬ 1    πŸ“Œ 0

Haven't done any training but I find SA a bit useless as you think it should know more than it actually does. I've had a lot of hallucinations from it and any positives are outweighed by the lack of persistent history. I use deepseek mainly now and it seems to be as good if not better.

28.02.2025 16:29 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Nice work! Your UI would work well with bslib::accordion

23.02.2025 16:52 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

You can wrap them in tagList(). I also just remembered about shiny::markdown which you might want to use. Then you can format more easily than using <strong> etc. which I've realised don't work that well in tags$ as you have to do tags$p("The quick brown", tags$em("fox"), "jumps over the lazy dog.")

20.02.2025 23:29 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Bit late, but I'd be happy to take a look. (One immediate comment would be to use round() on the stats like p-value)

20.02.2025 20:30 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

I'd suggest moving all your .R files to an R/ folder and then they get sourced automatically. If you make plot_annotations.R then you put your text inside a function in there, and just call that underneath the relevant plot

20.02.2025 19:59 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

@simonsmart is following 20 prominent accounts