Skip to content

Instantly share code, notes, and snippets.

Ryan Timpe ryantimpe

Block or report user

Report or block ryantimpe

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ryantimpe
ryantimpe / babyyoda.R
Created Feb 20, 2020
brickr_BabyYoda
View babyyoda.R
library(dplyr)
library(brickr)
library(rgl)
library(httr)
#Render a static model
GET("http://www.ryantimpe.com/files/babyyoda.xlsx", write_disk(tf <- tempfile(fileext = ".xlsx")))
babyyoda <- readxl::read_xlsx(tf, sheet = "BabyYoda") %>%
bricks_from_excel()
@ryantimpe
ryantimpe / brickr_Ex3_RandomForest.R
Created Mar 22, 2019
{brickr} Example - Random Forest
View brickr_Ex3_RandomForest.R
library(tidyverse)
library(brickr)
display_colors()
random_tree <- function(xloc, yloc, height, radius){
startz <- round(height * (2/5))
#Build a 3x3 trunk
trunk_coords <- expand.grid( x = -1:1, y = -1:1,
@ryantimpe
ryantimpe / brickr_Ex2_Owl.R
Created Mar 15, 2019
{brickr} Example - Build an owl
View brickr_Ex2_Owl.R
library(brickr)
source(brickr_Owl_design.R)
#Remind me of the color names again...
display_colors()
#Use those names in the Color column
owl_colors <- tibble::tribble(
~.value, ~Color,
1, "Bright orange",
@ryantimpe
ryantimpe / brickr_Ex1.R
Created Mar 15, 2019
{brickr} Getting Started
View brickr_Ex1.R
library(brickr)
#This is a brick
brick <- data.frame(
Level="A",
X1 = rep(1,4),
X2 = rep(1,4)
)
brick %>%
@ryantimpe
ryantimpe / TurkeyVelociraptorPlot.R
Last active Nov 25, 2018
Plot phylopic images to compare raptor size in Jurassic Park to reality
View TurkeyVelociraptorPlot.R
library(tidyverse); library(rvest);
library(png)
#Phylopic images here:
https://github.com/ryantimpe/ChartOfTheDay/tree/master/data
#Text wrapping function ---
wrapper <- function(x, ...) {paste(strwrap(x, ...), collapse = "\n")}
#Scale image into feet
You can’t perform that action at this time.