https://fosstodon.org/@HeathrTurnr ; Heather Turner
https://fosstodon.org/@trevin_flick ; Trevin Flickinger
https://fosstodon.org/@jonthegeek ; Jon Harmon
https://fosstodon.org/@samherniman ; Sam Herniman
https://mastodon.social/@SagePhoenixDM ; Alan Jackson
https://fosstodon.org/@ivelasq3 ; Isabella Velásquez
https://mastodon.social/@bhogale ; Prasanna Bhogale
https://fosstodon.org/@Drmowinckels ; Mo - Athanasia Mowinckel
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | stopifnot(requireNamespace("rlang")) | |
| rlang::check_installed("pak") | |
| pkgs <- rlang::chr( | |
| "rlang" = "rlang", | |
| "plumber2" = "posit-dev/plumber2", | |
| "S7", | |
| "jsonlite", | |
| "httr2", | |
| "mirai", | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/bin/bash | |
| set -e # stop on error | |
| cd ~/github/r-devel/r-svn | |
| # reset | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | library(doFuture) | |
| plan(multisession, workers = 32) | |
| options(scipen = 999) | |
| anysvd <- function(id, dim = 10, nrep = 300) { | |
| results <- vector("list", nrep) | |
| for (j in 1:nrep) { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # Remove ProjectID from .Rproj files if freshly added | |
| local({ | |
| xfun <- requireNamespace("xfun", quietly = TRUE) | |
| rproj_files <- list.files(pattern = "\\.Rproj$", full.names = TRUE) | |
| if (!xfun || length(rproj_files) == 0L) return(invisible(NULL)) | |
| lapply(rproj_files, function(f) { | |
| diff_cmd <- system(paste("git diff --", shQuote(f)), intern = TRUE) | |
| diff_out <- tryCatch(diff_cmd, error = function(e) character(0)) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # What do i want from an object oriented R class system? | |
| # opt-in public immutability - neither. Accomplished with private property with active binding in R6 | |
| # interior mutability - R6 | |
| # type safety - S7 | |
| # self-referential methods - R6 | |
| # private methods don't have any type safety they can be whatever you want. | |
| # immutables can only be set at creation and class doesn't matter | |
| # Each .public & .private element must be named | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # Top-level | |
| thefuck <- function(e = rlang::last_error()) { | |
| stopifnot(rlang::is_call_simple(e$call)) | |
| if (grep("^unused argument", e$message)) { | |
| fix_unused_arg(e) | |
| } | |
| # ... more cases | |
| } | |
| # Internal methods | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
    | n | 1 | 2 | 4 | 8 | 16 | |
|---|---|---|---|---|---|---|
| dplyr | 5093.77 | 2671.44 | 1447.21 | 810.42 | 446.06 | |
| data.table | 1336.79 | 677.94 | 364.5 | 217.75 | 143.95 | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # Clone repo | |
| git clone https://github.com/keaven/gsDesign.git | |
| cd gsDesign | |
| # Run gource - this will generate a 411GB ppm file | |
| gource -3840x2160 --seconds-per-day 0.1 --auto-skip-seconds 0.01 --file-idle-time 0 --font-size 34 --key --logo man/figures/logo.png -o gsDesign.ppm | |
| # Convert ppm to mp4 | |
| ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i gsDesign.ppm -vcodec libx264 -preset medium -pix_fmt yuv420p -crf 1 -threads 0 -bf 0 gsDesign.mp4 | |
| # Merge audio to video | |
| ffmpeg -i gsDesign.mp4 -i music.mp3 -c:v copy -c:a aac output.mp4 | |
| # Recommended by YouTube | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | data(diamonds, package = "ggplot2") | |
| # Most straightforward | |
| diamonds$ppc <- diamonds$price / diamonds$carat | |
| # Avoid repeating diamonds | |
| diamonds$ppc <- with(diamonds, price / carat) | |
| # The inspiration for dplyr's mutate | |
| diamonds <- transform(diamonds, ppc = price / carat) | 
NewerOlder