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(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(rayshader) | |
library(rayrender) | |
library(ggplot2) | |
ggdiamonds = ggplot(diamonds) + | |
stat_density_2d(aes(x = x, y = depth, fill = stat(nlevel)), | |
geom = "polygon", n = 200, bins = 50,contour = TRUE) + | |
facet_wrap(clarity~.) + | |
scale_fill_viridis_c(option = "A") |
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
Social | |
github.com/pedrocoutinhosilva | |
linkedin.com/in/pedrocoutinhosilva | |
twitter.com/sparktuga | |
www.pedrocsilva.com | |
Examples | |
https://appsilon.com/journey-from-basic-prototype-to-production-ready-shiny-dashboard/ | |
http://uaborder.com/ | |
https://appsilon.com/is-it-possible-to-build-a-video-game-in-r-shiny/ |
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(dplyr) | |
library(forcats) | |
library(ggplot2) | |
library(palmerpenguins) | |
library(ggtext) | |
library(colorspace) | |
library(ragg) | |
url <- "https://raw.githubusercontent.com/allisonhorst/palmerpenguins/master/man/figures/lter_penguins.png" | |
img <- magick::image_read((url)) |
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(rnaturalearthdata) | |
library(sf) | |
library(ggthemes) | |
country_sf <- countries110 %>% | |
st_as_sf() | |
ggplot() + | |
geom_sf(data = country_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
#Load all the libraries needed | |
library(sf) | |
library(dplyr) | |
library(rayrender) | |
library(elevatr) | |
library(rayshader) | |
library(geojsonsf) | |
library(raster) | |
library(lidR) |
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) | |
manufacturers <- mpg |> | |
count(manufacturer, sort = TRUE) |> | |
mutate( | |
manufacturer = str_to_title(manufacturer), | |
manufacturer = fct_reorder(manufacturer, n) | |
) |
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) | |
volcano |> | |
height_shade() |> | |
plot_3d(volcano,zscale=3) | |
render_contours(volcano, clear_previous = T, offset=1,color="purple", | |
zscale=3, nlevels = 20) | |
for(i in 1:360) { |
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(tidycensus) | |
library(tidyverse) | |
options(tigris_use_cache = TRUE) | |
state_names <- c(state.name, "District of Columbia") | |
names(state_names) <- state_names | |
tictoc::tic() | |
age_maps <- map(state_names, ~{ | |