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
dat <- structure(list(Move = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, | |
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, | |
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, | |
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, | |
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, | |
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, | |
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, | |
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, | |
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, | |
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, |
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
library(tidyverse) | |
df_students <- readr::read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2019/2019-05-07/student_teacher_ratio.csv") | |
df_world_tile <- readr::read_csv("https://gist.githubusercontent.com/maartenzam/787498bbc07ae06b637447dbd430ea0a/raw/9a9dafafb44d8990f85243a9c7ca349acd3a0d07/worldtilegrid.csv") %>% | |
mutate( | |
## Namibias two-digit country code is handled as `NA` - let us fix that | |
alpha.2 = if_else(name == "Namibia", "NA", alpha.2), | |
## We are going to split "Americas" into "North America" and "Sout America" | |
region = if_else(region == "Americas", sub.region, region), |
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
##----------------------------------------------------------------------------------------------------------## | |
## Cedric Scherer ([email protected]) ## | |
## Function for a custom ggplot theme ## | |
## 2017-05-27 ## | |
##----------------------------------------------------------------------------------------------------------## | |
library(ggplot2) | |
if ("extrafont" %in% rownames(installed.packages())) | |
{ |
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
## from Hugo Toscano: https://github.com/toscano84/TidyTuesday/blob/master/Week23/TT_week23_fastfood.R | |
"%||%" <- function(a, b) { | |
if (!is.null(a)) | |
a | |
else | |
b | |
} | |
geom_flat_violin <- |
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
``` r | |
library(tidyverse) | |
library(raster) | |
library(sf) | |
#> Linking to GEOS 3.6.1, GDAL 2.2.3, PROJ 4.9.3 | |
oceans <- | |
rnaturalearth::ne_download(scale = 10, | |
category = "physical", | |
type = "ocean", |
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
library(tidyverse) | |
library(lubridate) | |
locations <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-06-23/locations.csv') | |
movement <- locations %>% | |
filter(study_site != "Hart Ranges") %>% | |
mutate( | |
season = fct_rev(season), # reverse seasons | |
longitude = round(longitude, 2), # round long, lat to reduce number of points |
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
library(tidyverse) | |
library(patchwork) | |
df <- tibble(x = 1, y = 1) | |
g <- ggplot(df, aes(x, y)) + | |
scale_x_continuous(expand = c(0, 0)) + | |
scale_y_continuous(expand = c(0, 0)) + | |
coord_cartesian(clip = "off") + | |
theme_void() + |
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
library(shiny) | |
library(tmap) | |
data(World) | |
world_vars <- setdiff(names(World), c("iso_a3", "name", "sovereignt", "geometry")) | |
ui <- fluidPage( | |
tmapOutput("map"), | |
selectInput("var", "Variable", world_vars) |
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
library(shiny) | |
library(tmap) | |
library(tidyverse) | |
library(fullPage) | |
data(World) | |
world_vars <- setdiff(names(World), c("iso_a3", "name", "sovereignt", "geometry")) | |
ui <- pagePiling( | |
sections.color = c('#ebebeb', '#f1f1f1'), |
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
#### 1. Sign up at GitHub.com ################################################ | |
## If you do not have a GitHub account, sign up here: | |
## https://github.com/join | |
# ---------------------------------------------------------------------------- | |
#### 2. Install git ########################################################## | |
## If you do not have git installed, please do so: |
OlderNewer