Skip to content

Instantly share code, notes, and snippets.

View z3tt's full-sized avatar
👨‍💻
Coding at home

Cédric Scherer z3tt

👨‍💻
Coding at home
View GitHub Profile
@parmentf
parmentf / GitCommitEmoji.md
Last active May 6, 2024 18:30
Git Commit message Emoji
@lopspower
lopspower / README.md
Last active May 7, 2024 23:40
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

library(ggplot2)
# dput(ls(pattern = "theme",package:ggplot2))
defaults <- c("theme_bw", "theme_classic", "theme_dark",
"theme_grey", "theme_light", "theme_linedraw",
"theme_minimal", "theme_void")
library(ggthemes)
# dput(ls(pattern = "theme",package:ggthemes))
addons <- c("theme_base", "theme_calc", "theme_economist",
"theme_economist_white", "theme_excel", "theme_few", "theme_fivethirtyeight",
"theme_foundation", "theme_gdocs", "theme_hc", "theme_igray",
@maartenzam
maartenzam / readme.md
Created October 22, 2017 20:25
World Tile Grid Map in ggplot2
#####################################################
#####################################################
### R Script for Metamodeling and Rule Extraction ###
#####################################################
#####################################################
#############################
### Step I: Load Packages ###
#############################
library(tidyverse)
library(lubridate)
library(scales)
df <- tibble(
date = seq.Date(from=ymd("2019-01-01"),to=ymd("2019-12-31"),by="day"),
wkdy = wday(date,label=T),
mo = month(date,label=T),
mo.num = month(date,label=F),
day = day(date)
@jsta
jsta / zenodo.R
Created March 11, 2019 00:46
Download files from Zenodo record id
#' Download files from Zenodo record id
#'
#' @param record_id record id
#' @param dest_folder destination folder for file downloads
#' @param token API key
#'
#' @details https://github.com/zenodo/zenodo/issues/1629#issuecomment-435062462
#'
#' @importFrom httr GET content
#' @importFrom jsonlite fromJSON
@fzenoni
fzenoni / ortho_view.R
Last active November 2, 2023 11:06
Preserve polygons in orthographic view
# Download earth data first
# https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/physical/ne_110m_land.zip
library(sf)
library(lwgeom)
library(dplyr)
library(ggplot2)
library(mapview)
# Read the data
@joshua-feldman
joshua-feldman / prepend_functions.R
Last active February 11, 2024 13:24
Prepend all functions in an R script with package name
# Load the relevant packages
library(NCmisc)
library(stringr)
# Load the script and parse lines
file_name <- "example_script.R"
file_lines <- readLines(file_name)
# Save the function and package names
functions_list <- list.functions.in.file(file_name)
# =======================================
# = Enhancements to data tidying =
# = Hadley Wickham =
# = https://rstd.io/tidyhancements-2019 =
# =======================================
# What is tidy data? ----------------------------------------------------------
# 1. Each column is a variable.
# 2. Each row is an observation.
# 3. Each cell is a value.