Allow user of R6 class to provide function which access `self`

Goal I want to tweak the following R6 class such that calc is not hard coded but can be provided by the user. Hard Coded library(R6) A <- R6Class("A", public = list( run = function(x) { private$calc(x) }, result_codes = list(OK = 1, NOK = 2) ), private = list( calc = function(x) { if… Read More Allow user of R6 class to provide function which access `self`

How to center a select box in a cell table using HTML?

This may seem silly, but I’m a beginner here and I can’t wrap my head around this one: Fiddle <table class="table table-sm table-striped" id="dtable" style="font-size:0.9em"> <thead style="white-space: nowrap"> <tr> <th style="width: 17%" class="text-center">Link To File</th> <th style="width: 18%" class="text-center">Approval Status</th> </thead> <tbody> <tr> <td class="align-middle" style="word-wrap: break-word;min-width: 160px;max-width: 160px;text-align:center">2</td> <td class="align-middle" style="align-center"> <select name="D1" style="border-radius:… Read More How to center a select box in a cell table using HTML?

How can I calculate the smallest difference in days between date in dictionaries that have the same label python

I have dictionaries like this : tr1 = {‘label’: ‘name1’, ‘date’: ‘2021-09-29’} tr2 = {‘label’: ‘name1’, ‘date’: ‘2021-08-30’} tr3 = {‘label’: ‘name1’, ‘date’: ‘2021-09-30’} tr4 = {‘label’: ‘name2’, ‘date’: ‘2021-06-30’} tr5 = {‘label’: ‘name2’, ‘date’: ‘2021-05-30’} tr6 = {‘label’: ‘name3’, ‘date’: ‘2021-06-30’} And I want to get a list like this : [1, 1, 1,… Read More How can I calculate the smallest difference in days between date in dictionaries that have the same label python

How to use `label_date_short`?

How I am using wrongly label_date_short from scales package? library(tidyverse) library(scales) date_taille <- tibble( Taille = rep(c("taille_hiver", "taille_ete"), times = 2), Date_taille = c("2016-08-01", "2016-02-01", "2018-08-01", "2018-02-01") %>% as.Date() ) ggplot(date_taille) + aes(x = Date_taille, y = Taille) + geom_point() + scale_x_date(date_breaks = "month", date_labels = label_date_short()) #or label_date() #> Error in format(x, format =… Read More How to use `label_date_short`?

Link to R6 method from separate package in help pages and pkgdown

Cross posted from: https://community.rstudio.com/t/link-to-r6-method-from-separate-package-in-help-pages-and-pkgdown/134702 I’m currently writing an R package and would like to link to the help page for an R6 method in a separate package. The page I want to link to is here: https://mc-stan.org/cmdstanr/reference/model-method-sample.html, and there is an .Rd file for the method as well (https://github.com/stan-dev/cmdstanr/blob/master/man/model-method-sample.Rd). Finally, I can also access the… Read More Link to R6 method from separate package in help pages and pkgdown