#循环初谈,jpeg的输出!!!
Owls <- read.table(file = "Owls.txt",header = T)
names(Owls)
str(Owls)
unique(Owls$Nest)
#setwd不是在编入的时候就不能改,而是调用入Rstudio的数据库bottomleft window储存起来;
#只是在读取原数据时设定一下;
#如果编过程中想选择别的出输出文件夹就可以换;
#mac直接用bottom right的window来设置路径,win则用setwd语句;
#注意paste()应用;
Nest.i<-"Bochet"
Owls.i<-Owls[Owls$Nest == Nest.i,]
YourFileName<-
paste(Nest.i,".jpg",sep = "")
jpeg(file=YourFileName) #jpeg到dev.off()中间都为jpeg输出
plot(x=Owls.i$ArrivalTime,y=Owls.i$NegPerChick,xlab = "Arrival Time",ylab = "Negotiation behaviour",main = Nest.i)
dev.off()