Skip to content

Instantly share code, notes, and snippets.

View darokun's full-sized avatar

Daloha Rodriguez-Molina darokun

  • Munich, Germany
View GitHub Profile
# Causallang screening process animated plot
# author: Daloha Rodriguez-Molina @darokun
# load packages
library(tidyverse)
library(gganimate)
library(readxl)
library(here)
# data
# log_scale_exercises.R
format(1*10^-4, scientific = FALSE) # starting point: 1*10^-4 = 1e-04 = 0.0001
format(1*10^-3, scientific = FALSE) # ending point: 1*10^-3 = 1e-03 = 0.001
x <- seq(0.0001:0.001, by = 0.0001, length.out = 10) # 10 datapoints ascending from 0.0001 to 0.001
format(x, scientific = FALSE) # 0.0001, 0.0002, 0.0003, [...], 0.0008, 0.0009, 0.001
format(x, scientific = TRUE) # the same, but in scientific notation: 1e-04, 2e-04, 3e-04, [...], 8e-04, 9e-04, 1e-03
plot(x, xlim = c(0, 10), ylim = c(0.0001, 0.001), pch = 20, log = "y") # plot log scale on y axis, (intervals are not equally spaced)
plot(x, xlim = c(0, 10), ylim = c(0.0001, 0.001), pch = 20) # plot linear scale, (equally spaced intervals)
# install.packages("ggchicklet", repos = "https://cinc.rud.is")
library(ggchicklet)
library(tidyverse)
x <- rep(letters[1:7], seq.int(0, 30, 5))
hb <- tibble(x)
hex_codes1 <- scales::hue_pal()(length(unique(hb$x)))
p1 <- ggplot(count(hb, x), aes(x = x, y = n)) +
geom_chicklet(radius = grid::unit(2, 'mm'), fill = hex_codes1, colour = "black") +
# PLASMID - abbreviations script
# install.packages("tidyverse") # run only if not previously installed
# install.packages("googlesheets4") # run only if not previously installed
library(tidyverse)
library(googlesheets4)
gs4_deauth() # deactivate authorization mode so it doesn't ask for google sign-in. Useful when only reading data
# read data
abb <- read_sheet("https://docs.google.com/spreadsheets/d/1ePlZC0FmFuqiq0B59wtNu4RCDEgypn_ucyBzFb8oK0g/edit#gid=0")
library(tidyverse)
library(here)
papers_filenames <- list.files(path = here::here("Library"),
pattern = "(201[8-9]|2020)",
full.names = TRUE)
file.copy(from = papers_filenames, to = here::here("Library", "subset"))
@darokun
darokun / yosaliporvenezuela.R
Created August 18, 2024 15:11
Mapa interactivo que muestra todos los lugares fuera de Venezuela desde donde los venezolanos salimos a expresarnos el 17 de agosto de 2024 en contra de la dictadura de Nicolás Maduro y en apoyo al presidente electo Edmundo González Urrutia. Link: http://rpubs.com/darokun/yosaliporvenezuela
library(tidyverse)
library(leaflet)
library(googlesheets4)
dat <- read_sheet("1q5Qo6j0fxpjJ9LtKXxkTya7-3YMTXh059c6rqonQP1A") %>%
filter(!is.na(pic))
icons <- awesomeIcons(
icon = "star",
iconColor = "white",