Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require(tidyverse)
- d1 <- read_csv2("data1.csv")
- d2 <- read_csv2("data2.csv")
- d3 <- read_csv2("data3.csv")
- d4 <- read_csv2("data4.csv")
- d5 <- read_csv2("data5.csv")
- d6 <- read_csv2("data6.csv")
- d7 <- read_csv2("data7.csv")
- d8 <- read_csv2("data8.csv")
- d9 <- read_csv2("data9.csv")
- d10 <- read_csv2("data10.csv")
- d10 <- d10 %>%
- filter(!is.infinite(z))
- good_plot <- function(df) {
- ggplot()+
- geom_path(data = df,aes(x = x,y = y, colour = "Victim")+
- geom_path(data = df,aes(x = x,y = z, colour = "Predator"))+
- scale_colour_manual(name = "Population",
- values = c(Victim = "red",Predator = "green"))
- }
- cycle_plot_y <- function(df) {
- ggplot()+
- geom_path(data = df,aes(x = y,y = yd), color = "blue")
- }
- cycle_plot_z <- function(df) {
- ggplot()+
- geom_path(data = df,aes(x = z,y = zd), color = "blue")
- }
- save_plot <- function(df,name){
- res <- ggplot()+
- geom_path(data = df,aes(x = x,y = y, colour = "Victim"))+
- geom_path(data = df,aes(x = x,y = z, colour = "Predator"))+
- scale_colour_manual(name = "Population",
- values = c(Victim = "red",Predator = "green"))
- ggsave(filename = name,res)
- }
- ggplot()+
- geom_path(data = d1,aes(x = x,y = y), color = "blue")+
- geom_path(data = d2,aes(x = x,y = y), color = "red")+
- geom_path(data = d3,aes(x = x,y = y), color = "orange")+
- geom_path(data = d4,aes(x = x,y = y), color = "green")+
- geom_path(data = d5,aes(x = x,y = y), color = "pink")+
- geom_path(data = d6,aes(x = x,y = y), color = "purple")+
- geom_path(data = d7,aes(x = x,y = y), color = "wheat")+
- geom_path(data = d8,aes(x = x,y = y), color = "purple")+
- geom_path(data = d9,aes(x = x,y = y), color = "khaki1")+
- geom_path(data = d10,aes(x = x,y = y), color = "black")+
- xlab("x")+ylab("y")
- good_plot(d1)
- save_plot(d1,"plot1.jpg")
- good_plot(d2)
- save_plot(d2,"plot2.jpg")
- cycle_plot_y(d2)
- cycle_plot_z(d2)
- good_plot(d3)
- save_plot(d3,"plot3.jpg")
- cycle_plot_y(d3)
- cycle_plot_z(d3)
- good_plot(d4)
- save_plot(d4,"plot4.jpg")
- cycle_plot_y(d4)
- cycle_plot_z(d4)
- good_plot(d5)
- save_plot(d5,"plot5.jpg")
- good_plot(d6)
- save_plot(d6,"plot6.jpg")
- good_plot(d7)
- save_plot(d7,"plot7.jpg")
- good_plot(d8)
- save_plot(d8,"plot8.jpg")
- good_plot(d10)
- cycle_plot(d9)
- good_plot(d10)
- cycle_plot(d10)
- cycle_plot(d1)
- cycle_plot(d2)
- cycle_plot(d3)
- cycle_plot(d4)
- s1 <- read_csv2("second0.csv")
- s2 <- read_csv2("second1.csv")
- s3 <- read_csv2("second2.csv")
- s4 <- read_csv2("second3.csv")
- s5 <- read_csv2("second4.csv")
- s6 <- read_csv2("second5.csv")
- s7 <- read_csv2("second6.csv")
- s8 <- read_csv2("second7.csv")
- s9 <- read_csv2("second8.csv")
- s10 <- read_csv2("second9.csv")
- good_plot(s1)
- save_plot(s1,"splot1.jpg")
- good_plot(s2)
- save_plot(s2,"splot2.jpg")
- good_plot(s3)
- save_plot(s3,"splot3.jpg")
- cycle_plot_y(s3)
- cycle_plot_z(s3)
- good_plot(s4)
- save_plot(s4,"splot4.jpg")
- good_plot(s5)
- save_plot(s5,"splot5.jpg")
- good_plot(s6)
- save_plot(s6,"splot6.jpg")
- cycle_plot_y(s6)
- cycle_plot_z(s6)
- good_plot(s7)
- save_plot(s7,"splot7.jpg")
- good_plot(s8)
- save_plot(s8,"splot8.jpg")
- good_plot(s9)
- save_plot(s9,"splot9.jpg")
- cycle_plot_y(s9)
- cycle_plot_z(s9)
- good_plot(s10)
- save_plot(s10,"splot10.jpg")
- cycle_plot_y(s10)
- cycle_plot_z(s10)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement