Skip to content

Instantly share code, notes, and snippets.

View nahin29's full-sized avatar

Md Nahin Alam nahin29

View GitHub Profile
library(rayshader)
library(rayrender)
library(terra)
library(rnaturalearth)
library(MetBrewer)
library(raster)
library(exactextractr)
library(fasterize)
canopy_germany <- rast("germany/canopy_germany.tif")
library(tidyverse)
library(paletteer)
gradient_attempt <- data.frame(level = seq(1,300,by=1),
size = seq(30,0.1, by =-0.1))
prmtns <- data.frame(x = seq(0,60,by=30),
y = seq(0,60,by=30))%>%
expand(x, y)
final = crossing(prmtns, gradient_attempt)
@PaulC91
PaulC91 / wc_winners_animation.R
Last active November 5, 2021 01:24
R code to produce an animated map of FIFA World Cup Winners/Runners-up using the new gganimate package
library(tidyverse)
library(rvest)
library(opencage) # need to get opencage API key and save as env variable below https://geocoder.opencagedata.com/pricing
library(sf)
library(rnaturalearth)
library(gganimate) # devtools::install_github('thomasp85/gganimate')
library(hrbrthemes) # devtools::install_github('hrbrmstr/hrbrthemes')
Sys.setenv(OPENCAGE_KEY = "xxxxxxxxxxxxxxxx")
@seankross
seankross / bin_op.R
Created March 21, 2015 15:35
Swirl R Programming Script Answers
"%p%" <- function(left, right){
paste(left, right)
}