setwd('~/Desktop') library(ggplot2) library(grid) # Read files of raw data separately, including "Brids Haila 1983 S. Qiang 180314" ,“Fish Harrel 1967 S. Qiang 180314”,“Zooplankton Akifumi 1996 S. Qiang 180314” and "Total Dataset S. Qiang 180314". RawData <- read.csv(file.choose(), header = T) # Read the simulated Data "SE Simulated Data p=0.6 S. Qiang 180314" SESimulatedDatap0.6<- read.csv(file.choose(), header = T) # Read the simulated Data "SE Simulated Data p=1.2 S. Qiang 180314" SESimulatedDatap1.2<- read.csv(file.choose(), header = T) # Read the simulated Data "SE Simulated Data p=1.8 S. Qiang 180314" SESimulatedDatap1.8<- read.csv(file.choose(), header = T) # Read the simulated Data "SE Simulated Data p=2.4 S. Qiang 180314" SESimulatedDatap2.4<- read.csv(file.choose(), header = T) # Generate the figure that presents the empirical S-Epielou relationship from the fractal angle ggplot() + geom_line(data=SESimulatedDatap0.6, aes(x=S, y=Epielou, color=p)) + geom_line(data=SESimulatedDatap1.2, aes(x=S, y=Epielou, color=p)) + geom_line(data=SESimulatedDatap1.8, aes(x=S, y=Epielou, color=p)) + geom_line(data=SESimulatedDatap2.4, aes(x=S, y=Epielou, color=p)) + geom_point(data=RawData, aes(x=S, y=Epielou, color=p, shape=Tax), size=2.3) + scale_color_continuous(low="lightslateblue", high="firebrick1", space='rgb') + scale_y_continuous(limits = c(0,1.0)) # Generate the figure of linear relationships between S and Epielou. ggplot() + geom_point(data=RawData, aes(x=S, y=Epielou, shape=Tax), color = 'dodgerblue4', size=2.5) + geom_smooth(data=RawData, aes(x=S,y=Epielou),method='lm', color = 'maroon') + scale_y_continuous(limits = c(0,1.0)) # Generate the figure that presents the empirical S-Ehill relationship from the fractal angle ggplot() + geom_line(data=SESimulatedDatap0.6, aes(x=S, y=Ehill, color=p)) + geom_line(data=SESimulatedDatap1.2, aes(x=S, y=Ehill, color=p)) + geom_line(data=SESimulatedDatap1.8, aes(x=S, y=Ehill, color=p)) + geom_line(data=SESimulatedDatap2.4, aes(x=S, y=Ehill, color=p)) + geom_point(data=RawData, aes(x=S, y=Ehill, color=p, shape=Tax), size=2.3) + scale_color_continuous(low="lightslateblue", high="firebrick1", space='rgb') + scale_y_continuous(limits = c(0,1.0)) # Generate the figure of linear relationships between S and Ehill. ggplot() + geom_point(data=RawData, aes(x=S, y=Ehill, shape=Tax), color = 'dodgerblue4', size=2.5) + geom_smooth(data=RawData, aes(x=S,y=Ehill),method='lm', color = 'maroon') + scale_y_continuous(limits = c(0,1.0)) # Generate the figure that presents the empirical S-Ebulla relationship from the fractal angle ggplot() + geom_line(data=SESimulatedDatap0.6, aes(x=S, y=Ebulla, color=p)) + geom_line(data=SESimulatedDatap1.2, aes(x=S, y=Ebulla, color=p)) + geom_line(data=SESimulatedDatap1.8, aes(x=S, y=Ebulla, color=p)) + geom_line(data=SESimulatedDatap2.4, aes(x=S, y=Ebulla, color=p)) + geom_point(data=RawData, aes(x=S, y=Ebulla, color=p, shape=Tax), size=2.3) + scale_color_continuous(low="lightslateblue", high="firebrick1", space='rgb') + scale_y_continuous(limits = c(0,1.0)) # Generate the figure of linear relationships between S and Ebulla. ggplot() + geom_point(data=RawData, aes(x=S, y=Ebulla, shape=Tax), color = 'dodgerblue4', size=2.5) + geom_smooth(data=RawData, aes(x=S,y=Ebulla),method='lm', color = 'maroon') + scale_y_continuous(limits = c(0,1.0)) # Generate the figure that presents the empirical S-Evar relationship from the fractal angle ggplot() + geom_line(data=SESimulatedDatap0.6, aes(x=S, y=Evar, color=p)) + geom_line(data=SESimulatedDatap1.2, aes(x=S, y=Evar, color=p)) + geom_line(data=SESimulatedDatap1.8, aes(x=S, y=Evar, color=p)) + geom_line(data=SESimulatedDatap2.4, aes(x=S, y=Evar, color=p)) + geom_point(data=RawData, aes(x=S, y=Evar, color=p, shape=Tax), size=2.3) + scale_color_continuous(low="lightslateblue", high="firebrick1", space='rgb') + scale_y_continuous(limits = c(0,1.0)) # Generate the figure of linear relationships between S and Evar. ggplot() + geom_point(data=RawData, aes(x=S, y=Evar, shape=Tax), color = 'dodgerblue4', size=2.5) + geom_smooth(data=RawData, aes(x=S,y=Evar),method='lm', color = 'maroon') + scale_y_continuous(limits = c(0,1.0)) #end