Note
Note
Tip
Tip
| #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers | |
| // Windows Header Files | |
| #include <windows.h> | |
| #include "tchar.h" | |
| #include <iostream> | |
| #include <string> | |
| #include <format> | |
| #include <mutex> | |
| #include <unordered_map> | |
| #include <execution> |
| library(ggplot2) | |
| all_plots <- list() | |
| m <- as.matrix(penguins[,3:6]) | |
| for (i in 1:ncol(m)) { | |
| gg <- ggplot(penguins, aes(bill_len, m[,i])) + | |
| geom_point() + | |
| labs(title = sprintf("Column %i", i)) |
| stopifnot(requireNamespace("rlang")) | |
| rlang::check_installed("pak") | |
| pkgs <- rlang::chr( | |
| "tidymodels", | |
| "marginaleffects", | |
| "parameters", | |
| "modelbased", | |
| "dplyr", | |
| "stringr", | |
| "tibble", |
| #' Column selector for `[` and `[[` | |
| #' | |
| #' @param ... Column names provided as `character` or `symbol` (could be | |
| #' extended to allow other inputs!) | |
| #' @return A `numeric` vector of column indices to select | |
| #' | |
| #' @examples | |
| #' mtcars[cols(cyl, wt)] |> head() | |
| #' | |
| #' mtcars[cols(mpg:wt)] |> head() |
| library(tidyverse) | |
| library(gutenbergr) | |
| constitution_raw <- gutenberg_download(5) | |
| constitution <- constitution_raw |> | |
| slice(36:546) |> | |
| filter(text != "") |> | |
| mutate(text_lc = str_to_lower(text)) |> | |
| mutate(is_article = str_starts(text_lc, "article")) |> |
Note
Note
Tip
Tip
| #!/bin/bash | |
| # Function to measure execution time | |
| measure_time() { | |
| start_time=$(date +%s.%N) | |
| "$@" | |
| end_time=$(date +%s.%N) | |
| execution_time=$(echo "$end_time - $start_time" | bc) | |
| echo "Execution time: $execution_time seconds" | |
| } |
| library(magick) | |
| library(lofifonts) # remotes::install_github('coolbutuseless/lofifonts') | |
| library(purrr) | |
| bitmap_text_coords("Hello", font = 'unifont') |> | |
| head() | |
| text <- glue::glue("It is a period of civil war. | |
| Rebel spaceships, striking | |
| from a hidden base, have won |