This file contains 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: "rename github repo" | |
author: "Martin Monkman" | |
date: "2020/10/05" | |
output: html_document | |
--- | |
From | |
https://www.r-bloggers.com/2020/07/5-steps-to-change-github-default-branch-from-master-to-main/ |
This file contains 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
penguins <- palmerpenguins::penguins | |
penguins %>% | |
filter(!is.na(sex)) %>% | |
mutate(bm_quart = gtools::quantcut(body_mass_g, q=4)) | |
penguins_2 <- penguins %>% | |
filter(!is.na(sex)) %>% | |
select(species, sex, body_mass_g) %>% | |
# mutate(bm_quart = gtools::quantcut(body_mass_g, q=4)) |
This file contains 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
# {dplyr}'s `ungroup()` function | |
```{r} | |
# packages | |
library(gapminder) | |
library(dplyr) | |
``` | |
In this example, we calculate the difference in a country's life expectancy from the continent's mean life expectancy | |
- for example, the difference between life expectancy in Canada and the mean life expectancy of countries in the Americas |
This file contains 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
# OBJECTIVE: | |
# * latitude and longitude stored with degrees with degree symbol and minutes with decimal | |
# * separate into two columns for each, with degrees and minutes separated | |
# step 1 - create a test tibble called "geo_loc" | |
geo_loc <- tribble( ~ latitude, ~ longitude, | |
"48º 4.206", "124º 45.553", | |
"46º 59.4942", "124º 12.6362") | |
# --- | |
# step 2 - split into degrees and minutes columns |
This file contains 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
# modified from / inspired by @GShotwell | |
# gist: https://gist.github.com/GShotwell/b19ef520b6d56f61a830fabb3454965b | |
df <- tibble( | |
value = rnorm(100, 50, 10), | |
date = seq.Date(from = ymd("2022-01-01"), | |
ymd("2022-04-10"), | |
by = "day")) | |
OlderNewer