Skip to content

Instantly share code, notes, and snippets.

# Load Required Libraries
library(tidyverse) # All things tidy
library(sf) # Handling simple features in R
library(terra) # Handling rasters in R
library(tidyterra) # Rasters with ggplot2
library(scales) # Nice Scales for ggplot2
library(ggtext) # Markdown text in ggplot2
library(showtext) # Display fonts in ggplot2
library(colorspace) # Lighten and Darken colours
library(geodata) # Geospatial Data
# Load Required Libraries
library(tidyverse) # All things tidy
library(sf) # Handling simple features in R
library(terra) # Handling rasters in R
library(tidyterra) # Rasters with ggplot2
library(scales) # Nice Scales for ggplot2
library(ggtext) # Markdown text in ggplot2
library(showtext) # Display fonts in ggplot2
library(colorspace) # Lighten and Darken colours
library(geodata) # Geospatial Data
# Load Required Libraries
library(tidyverse) # All things tidy
library(sf) # Handling simple features in R
library(terra) # Handling rasters in R
library(tidyterra) # Rasters with ggplot2
library(scales) # Nice Scales for ggplot2
library(ggtext) # Markdown text in ggplot2
library(showtext) # Display fonts in ggplot2
library(colorspace) # Lighten and Darken colours
library(geodata) # Geospatial Data
@Heed725
Heed725 / worldclim_Ghana.R
Created January 27, 2025 16:53
WorldClim Code
# Load Required Libraries
library(tidyverse) # All things tidy
library(sf) # Handling simple features in R
library(terra) # Handling rasters in R
library(tidyterra) # Rasters with ggplot2
library(scales) # Nice Scales for ggplot2
library(ggtext) # Markdown text in ggplot2
library(showtext) # Display fonts in ggplot2
library(colorspace) # Lighten and Darken colours
library(geodata) # Geospatial Data
@Heed725
Heed725 / gist:aa2eb6d7f3460727beb55ab43373361a
Created October 30, 2024 10:23
Landcover 4 classes GEE
#Link for full code https://code.earthengine.google.com/1a58355cacea8ad233df6ba8788f2455?noload=1
// Import the Dynamic World dataset
var dwComposite = ee.ImageCollection('GOOGLE/DYNAMICWORLD/V1')
.filter(ee.Filter.date('2016-01-01', '2016-12-31'))
.select('label');
// Create a composite image
var composite = dwComposite.mosaic().clip(geometry);
@Heed725
Heed725 / Bivariate.R
Created October 9, 2024 08:27
Tanzania Bivariate Full code
#All credits to Mohammad Mohsin Raza
# Load required libraries
library(tidyverse)
library(sf)
library(terra)
library(rgeoboundaries)
library(climateR)
library(biscale)
library(cowplot)
@Heed725
Heed725 / Earth.R
Created August 1, 2024 05:58
Earth Rotating(Rayrender/Rayshader)
######################################
Primary Notes Before you go into Venturing this code
-Make sure you install FFMPEG On Your computer for animation(Gyan.dev or BtbN)
-Make sure you install Rtools for good functionality of Rayrender and Rayshader
-Make sure you download Rayrender and Rayshader package within Rstudio
-Make sure you have Earth Texture or any Planetary Texture
-link for Earth Textures:https://www.shadedrelief.com/natural3/pages/textures.html
-link for Solar system Textures:https://www.solarsystemscope.com/textures/
library(tidyverse)
library(afrilearndata)
library(sf)
library(raster)
library(rayshader)
mgc = africountries %>% filter(name=="Tanzania")
mgp = mask(afripop2020, mgc)