Last active
May 25, 2021 13:39
-
-
Save szimmer/2b73c4a446e27cc5e4d72ec2653a0f22 to your computer and use it in GitHub Desktop.
rayshader rmd
This file contains 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: "Untitled" | |
author: "Stephanie" | |
date: "5/25/2021" | |
output: html_document | |
--- | |
```{r setup, include=FALSE} | |
knitr::opts_chunk$set(echo = TRUE) | |
``` | |
## GGplot | |
```{r ggp} | |
library(tidyverse) | |
library(rayshader) | |
ggdiamonds = ggplot(diamonds, aes(x, depth)) + | |
stat_density_2d(aes(fill = stat(nlevel)), geom = "polygon", n = 200, bins = 50,contour = TRUE) + | |
facet_wrap(clarity~.) | |
ggdiamonds | |
``` | |
## Rayshader | |
```{r rayshader} | |
plot_gg(ggdiamonds,multicore = TRUE,width=5,height=5,scale=250, | |
zoom = 0.55, phi = 30) | |
render_snapshot() | |
rgl::rgl.close() | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment