This file contains hidden or 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(rayshader) | |
montereybay2 = montereybay | |
montereybay2[montereybay2<0] = 0 | |
for(i in 1:720) { | |
montereybay2 %>% | |
sphere_shade() %>% | |
add_water(detect_water(montereybay2), color="lightblue") |> | |
add_shadow(cloud_shade(montereybay2,zscale=50, sun_altitude = 90, seed=10, attenuation_coef = 1, time=i, |
This file contains hidden or 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(rayrender) | |
#Generate CSG branches | |
branches0 = csg_cone(end=c(0,0.5,0)) %>% | |
csg_combine(csg_cone(start=c(0,0.25,0),end=c(0,0.75,0), radius=0.75), operation="blend", radius = 0.7)%>% | |
csg_scale(1.25) | |
branches1 = csg_cone(end=c(0,0.5,0)) %>% | |
csg_combine(csg_cone(start=c(0,0.25,0),end=c(0,0.75,0), radius=0.75), operation="blend", radius = 0.7) |
This file contains hidden or 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(geojsonsf) | |
library(sf) | |
library(rayrender) | |
#Data source: https://github.com/telegeography/www.submarinecablemap.com | |
cables = geojson_sf("cable-geo.json") | |
cablescene = list() | |
counter = 1 | |
for(i in 1:length(cables$geometry)) { |
This file contains hidden or 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
# data: https://sedac.ciesin.columbia.edu/data/collection/gpw-v4 | |
library(rayshader) | |
library(rayrender) | |
popdata = raster::raster("gpw_v4_population_density_rev11_2020_15_min.tif") | |
population_mat = rayshader:::flipud(raster_to_matrix(popdata)) | |
above1 = population_mat > 1 |
This file contains hidden or 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(rayshader) | |
library(rayrender) | |
popdata = raster::raster("gpw_v4_population_density_rev11_2020_15_min.tif") | |
population_mat = rayshader:::flipud(raster_to_matrix(popdata)) | |
above1 = population_mat > 1 | |
above5 = population_mat > 5 | |
above10 = population_mat > 10 |
This file contains hidden or 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(systemfonts) | |
mpg_sum <- mpg %>% | |
## just use 2008 data | |
dplyr::filter(year == 2008) %>% | |
## turn into lumped factors with capitalized names | |
dplyr::mutate( | |
manufacturer = stringr::str_to_title(manufacturer), | |
manufacturer = forcats::fct_lump(manufacturer, n = 10) |
This file contains hidden or 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
## ----setup,include=FALSE,message=FALSE,warning=FALSE----------------------------------------------------------------------------------------------------------------------------------------------------- | |
library("here") # 1.0.1 | |
library("sf") # 1.0-14 | |
library("rgl") # 1.2.1 | |
library("geoviz") # 0.2.2 | |
library("raster") # 3.6-26 | |
library("rayshader") # 0.35.7 | |
library("osmdata") # 0.2.5 | |
library("tidyverse") # 2.0.0 |
This file contains hidden or 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
--- | |
title: "Flexdashboard theming demo" | |
runtime: shiny | |
output: | |
flexdashboard::flex_dashboard: | |
theme: | |
bg: "#101010" | |
fg: "#FDF7F7" | |
primary: "#ED79F9" | |
base_font: !expr bslib::font_google("Prompt") |
This file contains hidden or 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
#=============================================================================== | |
# 2021-01-07 -- twitter | |
# Visualize Publons country data | |
# https://publons.com/country | |
# Ilya Kashnitsky, [email protected] | |
#=============================================================================== | |
library(tidyverse) | |
library(magrittr) | |
library(sf) |
This file contains hidden or 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
# 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 |