Jeevan Rai

My thoughts, opinions and experiences

Category: Wildlife Study Design and Data Analysis

  • Two y-axes in R

    Two y-axes in R

    Recently, I had to plot two axes in a single graph. Like always, I googled. Countless solutions but most of them were not what I was looking for. These worked. But I didn’t want a complicated solution. Finally, two sources worked for me. However, I had to modify these codes to meet my needs. So,…

  • How to write functions in R? The shortest version

    How to write functions in R? The shortest version

    Lets create a function to add two numbers in R add <- function(a,b){ a+b} Thats it. 🙂 add(1,7) [1] 8

  • How to collapse Detection History for Occupancy Analysis?

    How to collapse Detection History for Occupancy Analysis?

    Recently a friend of mine asked me if I could help him collapse his detection history. He want to make 5 days as a single occassion. You might want to do this for vairous reasons. The most important one is that you want to get your detection probability higher. Suppose you detected your species once…