Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. if(length(Molt[Molt==0])=1){ #If there is just one sighting of molt code 0
  2. 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
  3. Results=rbind(Results,c(SPENO[i],0,Diff0,(Date[Molt==0]),Season))
  4.  
  5. if(length(Molt[Molt==0])>0&length(Molt[Molt==1])>0){ #If there is more than one sighting of molt code 0
  6. First_0=min(Date[Molt==0]) #Calculate first 0 instance
  7. First_1=min(Date[Molt==1]) #Calculate first 1 instance
  8. Diff_0=First_1-First_0 #Calculate difference
  9. Results=rbind(Results,c(SPENO[i],0,Diff_0,First_0,Season))
  10. }
  11. ```
  12.  
  13. The output I get from the code for stage 0 when stage 1 - 57 days:
  14.  
  15. 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