本文分享基于R绘制圣诞树~~~
a s
一个成成品~~~
# load packages
library(tidyverse)
library(rlang)
# source grow_tree.R script (assuming it is in the /R subdirectory of the working directory)
source('C:/Users/xx/R/grow_tree.R')#主函数
# define simple angle, length and survival functions
angle_fun1 <- function(angle) angle + c(-0.1 * pi, 0.1 * pi)
# angle: parent angle +- 0.1pi
length_fun1 <- function(length) 0.85 * length
# length: 85% of parent length
surv_fun1 <- function() 0.9