# installed by winget
winget install PowerShell-Preview
winget install git
git config --global user.name "Christophe Dervieux"
git config --global user.email christophe.dervieux@gmail.com
winget install rstudio
winget install vscode
winget install -e R
winget install Github.GithubDesktop
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(magick) | |
| library(reshape2) | |
| library(dplyr) | |
| library(tidygraph) | |
| library(particles) | |
| library(animation) | |
| plot_fun <- function(sim) { | |
| df <- as_tibble(sim) | |
| plot(df$x, df$y, col = df$color, pch = '.', axes = FALSE, xlim = c(-100, 317), ylim = c(-268, 100), xlab = NA, ylab = NA) |
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(rclipboard) | |
| library(shiny) | |
| # The UI | |
| ui <- bootstrapPage( | |
| rclipboardSetup(), | |
| # Add a text input | |
| textInput("copytext", "Copy this:", "Zlika!"), |
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(shiny) | |
| library(DT) | |
| library(dplyr) | |
| source_data <- | |
| iris %>% | |
| mutate(Species = as.factor(Species)) | |
| source_data$Date <- Sys.time() + seq_len(nrow(source_data)) |
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
| if (!require("pacman")) install.packages("pacman") | |
| pacman::p_load( | |
| dplyr, | |
| tidyselect, | |
| DT, | |
| gh | |
| ) | |
| pacman::p_load_current_gh("ropenscilabs/roomba") |
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
| { | |
| "theme": "dark", | |
| "autoUpdate": true, | |
| "snippet": { | |
| "expanded": true, | |
| "newSnippetPrivate": false, | |
| "sorting": "updated_at", | |
| "sortingReverse": true | |
| }, | |
| "editor" : { |
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
| code <- | |
| "library(shiny) | |
| library(dplyr) | |
| library(ggplot2) | |
| input <- list(cty = 15) | |
| df = shiny::reactive({ | |
| x <- input$cty | |
| mpg %>% filter(cty < x) | |
| }) |
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
| # Step 1 ------------------------------------------------------------------ | |
| # Before updating R... | |
| `%>%` <- magrittr::`%>%` | |
| # Thanks Chuck Powell - https://ibecav.github.io/update_libraries/ | |
| package_source <- function(pkg){ | |
| x <- as.character(packageDescription(pkg)$Repository) | |
| if (length(x)==0) { | |
| y <- as.character(packageDescription(pkg)$GithubRepo) |
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
| get_os <- function() { | |
| if (.Platform$OS.type == "windows") { | |
| "win" | |
| } else if (Sys.info()["sysname"] == "Darwin") { | |
| "mac" | |
| } else if (.Platform$OS.type == "unix") { | |
| "unix" | |
| } else { | |
| stop("Unknown OS") | |
| } |