On Oct 18, 2011, at 2:53 PM, Dennis Murphy wrote:
Prompted by David's xtabs() suggestion, one way to do what I think the
OP wants is to
* define day and unit as factors whose levels comprise the full range
of desired values;
* use xtabs();
* return the result as a data frame.
Something like
x
Thanks you for the quick and helpful replies. Problem solved.
Jonny
On Tue, Oct 18, 2011 at 11:33 AM, David Winsemius wrote:
>
> On Oct 18, 2011, at 2:24 PM, Sarah Goslee wrote:
>
> Hi Jonny,
>>
>> On Tue, Oct 18, 2011 at 1:02 PM, Jonny Armstrong
>> wrote:
>>
>>> I am analyzing the spatial distr
Prompted by David's xtabs() suggestion, one way to do what I think the
OP wants is to
* define day and unit as factors whose levels comprise the full range
of desired values;
* use xtabs();
* return the result as a data frame.
Something like
x <- data.frame( day = factor(rep(c(4, 6), each = 8),
On Oct 18, 2011, at 2:24 PM, Sarah Goslee wrote:
Hi Jonny,
On Tue, Oct 18, 2011 at 1:02 PM, Jonny Armstrong
wrote:
I am analyzing the spatial distribution of fish in a stream. The
stream is
divided into equally sized units, and the number of fish in each
unit is
counted. My problem is tha
Here is one option:
a<- data.frame(day=c(rep(4,8),rep(6,8)),unit=
c((1:8),seq(2,16,2)),value=round(runif(16,1,34),0)) #approx your data
b<- data.frame(day=c(rep(4,16),rep(6,16)),unit= 1:16) #fake df
b1<-merge (a,b, by=c('day','unit'),all.y=T)
b1$value[is.na(b1$value)]<-0
Hi Jonny,
On Tue, Oct 18, 2011 at 1:02 PM, Jonny Armstrong
wrote:
> I am analyzing the spatial distribution of fish in a stream. The stream is
> divided into equally sized units, and the number of fish in each unit is
> counted. My problem is that my dataset is missing rows where the count in a
>
6 matches
Mail list logo