Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(length(Molt[Molt==0])=1){ #If there is just one sighting of molt code 0
- Diff0=(Date[Molt==1])-(Date[Molt==0]) #just get the difference between stage 0 date and stage 1 date ---to get duration of stage 0
- Results=rbind(Results,c(SPENO[i],0,Diff0,(Date[Molt==0]),Season))
- if(length(Molt[Molt==0])>0&length(Molt[Molt==1])>0){ #If there is more than one sighting of molt code 0
- First_0=min(Date[Molt==0]) #Calculate first 0 instance
- First_1=min(Date[Molt==1]) #Calculate first 1 instance
- Diff_0=First_1-First_0 #Calculate difference
- Results=rbind(Results,c(SPENO[i],0,Diff_0,First_0,Season))
- }
- ```
- The output I get from the code for stage 0 when stage 1 - 57 days:
- The gives me results for the first code where I actually state that it should not use the code because I have more than one observation. The output is then 10 and 7 (next to each other, which messes up my results table at the end), but I should not have an output for the code. While for the second part where I state the code should be used, the output is given as 10, which is correct.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement