- Joined
- Jun 1, 2017
- Messages
- 241
Any other axe geeks out there writing code about axes and usage? Here's a start- in r
# Wood Waste from chopping
# Formula for wood waste from chopping (pi*R^2*R)/(pi*R^2*H)
library("ggplot2")
Lmin<- 3 #this is the minimum log length plotted in inches
Lmax<- 30 #this is the maximum log length plotted in inches
Rmin<- 1 #this is the minimum radius plotted in inches
Rmax<- 24 #this is the minimum radius plotted in inches
#Length <- rep(c(rep(6:40,24)),)
#Radius <- rep(c(rep(1:24,35)),)
Length <- rep(c(rep(Lmin:Lmax,Rmax)),)
Radius <- rep(c(rep(Rmin:Rmax,Lmax-Lmin)),)
Radius<-sort(Radius)
wood.waste<-as.data.frame(cbind(Radius, Length))
wood.waste$Percent.Waste<-(((pi*wood.waste$Radius^2*wood.waste$Radius)/(pi*wood.waste$Radius^2*wood.waste$Length))*100)
wood.waste$Radius<-as.factor(wood.waste$Radius)
wood.waste <- wood.waste[ which(wood.waste$Percent.Waste <100.1), ]
ggplot(wood.waste, aes(x=Length, y=Percent.Waste, color=Radius)) +
scale_y_continuous(name="Wood Waste (percent)",breaks=seq(0,100,10))+
scale_x_continuous(name="Log Length (inches)",breaks=seq(0,Lmax,5))+
labs(color = "Log Radius (inches)")+
geom_segment(aes(x = Lmin, y = 50, xend = Lmax, yend = 50), size = .5, colour = "black")+
annotate("text", x = 20, y = 15, label = "Sweet spot", size = 2.3, colour = "black")+
geom_line(aes(linetype=Radius)+
geom_point())
# Wood Waste from chopping
# Formula for wood waste from chopping (pi*R^2*R)/(pi*R^2*H)
library("ggplot2")
Lmin<- 3 #this is the minimum log length plotted in inches
Lmax<- 30 #this is the maximum log length plotted in inches
Rmin<- 1 #this is the minimum radius plotted in inches
Rmax<- 24 #this is the minimum radius plotted in inches
#Length <- rep(c(rep(6:40,24)),)
#Radius <- rep(c(rep(1:24,35)),)
Length <- rep(c(rep(Lmin:Lmax,Rmax)),)
Radius <- rep(c(rep(Rmin:Rmax,Lmax-Lmin)),)
Radius<-sort(Radius)
wood.waste<-as.data.frame(cbind(Radius, Length))
wood.waste$Percent.Waste<-(((pi*wood.waste$Radius^2*wood.waste$Radius)/(pi*wood.waste$Radius^2*wood.waste$Length))*100)
wood.waste$Radius<-as.factor(wood.waste$Radius)
wood.waste <- wood.waste[ which(wood.waste$Percent.Waste <100.1), ]
ggplot(wood.waste, aes(x=Length, y=Percent.Waste, color=Radius)) +
scale_y_continuous(name="Wood Waste (percent)",breaks=seq(0,100,10))+
scale_x_continuous(name="Log Length (inches)",breaks=seq(0,Lmax,5))+
labs(color = "Log Radius (inches)")+
geom_segment(aes(x = Lmin, y = 50, xend = Lmax, yend = 50), size = .5, colour = "black")+
annotate("text", x = 20, y = 15, label = "Sweet spot", size = 2.3, colour = "black")+
geom_line(aes(linetype=Radius)+
geom_point())