Blog Archives

Sample uniformly within a fixed radius.

May 16, 2014
By
Sample uniformly within a fixed radius.

I was asked how to do this today and thought that I would share the answer: ## Sample points uniformly within a fixed radiusnrand=1000maxstep=10## Sample data ## NB: To get a truly uniform sample over the circle, you must ## sample the square of the distance and then transform back.tempdat<-data.frame(X0=0,Y0=0, bearing0=0, bad.dist= runif(nrand)*maxstep,...

Read more »

RStudio and X2Go

April 28, 2014
By

After a recent system upgrade (to Linux Mint LMDE), I was no longer able to run RStudio through the remote desktop application X2Go. It turns out that this is due to a problem with the Qt libraries (see this website). As suggested here, I just deleted...

Read more »

Quantitative Ecology 2010-11-10 14:56:00

November 10, 2010
By

At last... I have been suffering with XEmacs displaying odd characters instead of the quotation marks that are used in R help files. This was driving me up the wall because it makes the files (and R output in general) very hard to read; however, I fina...

Read more »

Quantitative Ecology 2010-11-10 14:56:00

November 10, 2010
By

At last... I have been suffering with XEmacs displaying odd characters instead of the quotation marks that are used in R help files. This was driving me up the wall because it makes the files (and R output in general) very hard to read; however, I fina...

Read more »

ISO week

October 22, 2009
By

I am working with a model that produces estimates of snow water equivalent through time. Because I deal with large spatial extents, I decided to have the model produce weekly averages. The problem with this is knowing which file to access for a given d...

Read more »

ISO week

October 22, 2009
By

I am working with a model that produces estimates of snow water equivalent through time. Because I deal with large spatial extents, I decided to have the model produce weekly averages. The problem with this is knowing which file to access for a given d...

Read more »

Leap years

October 22, 2009
By

A quick function that when provided a numeric vector of years returns a boolean vector where TRUE == Leap year.is.leapyear=function(year){ #http://en.wikipedia.org/wiki/Leap_year return(((year %% 4 == 0) & (year %% 100 != 0)) | (year %% 400 == 0))}

Read more »

Leap years

October 22, 2009
By

A quick function that when provided a numeric vector of years returns a boolean vector where TRUE == Leap year.is.leapyear=function(year){ #http://en.wikipedia.org/wiki/Leap_year return(((year %% 4 == 0) & (year %% 100 != 0)) | (year %% 400 == 0))}

Read more »

Truncated Normal Distribution

September 3, 2009
By

Many distributions may be used to describe patterns that are non-negative; however, there are not as many choices when an upper bound is also needed (although the beta distribution is very flexible). For various reasons, truncated distributions are som...

Read more »

Truncated Normal Distribution

September 3, 2009
By

Many distributions may be used to describe patterns that are non-negative; however, there are not as many choices when an upper bound is also needed (although the beta distribution is very flexible). For various reasons, truncated distributions are som...

Read more »