Skip to content

Instantly share code, notes, and snippets.

@szimmer
Last active May 25, 2021 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save szimmer/2b73c4a446e27cc5e4d72ec2653a0f22 to your computer and use it in GitHub Desktop.
Save szimmer/2b73c4a446e27cc5e4d72ec2653a0f22 to your computer and use it in GitHub Desktop.
rayshader rmd
---
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