library(tidyverse)
library(mgcv)
#> Loading required package: nlme
#>
#> Attaching package: 'nlme'
#> The following object is masked from 'package:dplyr':
#>
#> collapse
#> This is mgcv 1.8-41. For overview type 'help("mgcv-package")'.
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(tidyverse) | |
| # Genuine confounding example. Sex confounds relationship between drug and death | |
| set.seed(0) | |
| n <- 1000000 | |
| is_male <- rbinom(n, 1, 0.5) | |
| drug <- rbinom(n, 1, 0.6 + 0.3*is_male) | |
| y <- rbinom(n, 1, 0.4 - 0.1*drug + 0.4*is_male) | |
| d <- tibble(drug, is_male, y) |
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
| #' --- | |
| #' title: Animate transition from PCA <--> tsne | |
| #' --- | |
| # idea from: https://jef.works/genomic-data-visualization-2024/blog/2024/03/06/akwok1/ | |
| #' ## Load packages and data | |
| library(ggplot2) | |
| library(gganimate) | |
| library(Rtsne) | |
| library(patchwork) |
I get asked pretty regularly what my opinion is on merge commits vs rebasing vs squashing. I've typed up this response so many times that I've decided to just put it in a gist so I can reference it whenever it comes up again.
I use merge, squash, rebase all situationally. I believe they all have their merits but their usage depends on the context. I think anyone who says any particular strategy is the right answer 100% of the time is wrong, but I think there is considerable acceptable leeway in when you use each. What follows is my personal and professional opinion:
See the new site: https://postgresisenough.dev
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
| ```{r} | |
| library(tidyverse) | |
| # https://www.produce.co.nz/seasonality-chart/ | |
| fruits <- tibble::tribble( | |
| ~ fruit, ~start, ~ end, | |
| "Blueberry", "October", "April", |
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(dplyr) | |
| library(ggplot2) | |
| library(patchwork) | |
| library(ggiraph) | |
| dat <- gapminder::gapminder |> | |
| janitor::clean_names() |> | |
| mutate( | |
| # ID that is shared for boxplots (this one uses factors, i.e. numbers, as ID instead of continents) |
Scraping a specific stat for this match. Inspiration here. You can get other player stats in a similar fashion.
library(httr)
library(tibble)
library(tidyr)
library(dplyr)
library(purrr)
library(janitor)