Thank you very much Michael!
Best,
Aurelie
On 2012-03-09, at 11:56 AM, R. Michael Weylandt wrote:
> You are overriding "b" at each loop iteration and consequently only
> keeping the last one.
>
> Perhaps
>
> b <- list()
>
> for(i in sort(unique(OT1$month))){
> a<-OT1[OT1$month==i,]
> b
Thank you Tal, useful link.
Best,
Aurelie
On 2012-03-09, at 11:53 AM, Tal Galili wrote:
> Hi Aurelie,
> Please give this a look:
> http://www.nealgroothuis.name/introduction-to-data-types-and-objects-in-r/
>
> And see if this resolves most, or all, of your questions...
>
>
> C
You are overriding "b" at each loop iteration and consequently only
keeping the last one.
Perhaps
b <- list()
for(i in sort(unique(OT1$month))){
a<-OT1[OT1$month==i,]
b[[i]]<-ppp(a$longitude,a$latitude,marks=a$fTSUM,window=newW)
plot(b[[i]],main=i)
}
Generally it's bad practi
Hi Aurelie,
Please give this a look:
http://www.nealgroothuis.name/introduction-to-data-types-and-objects-in-r/
And see if this resolves most, or all, of your questions...
Contact
Details:---
Contact me: tal.gal...@gmail.com |
Dear all,
I'm trying to create a list of point patterns ppp.object {spatstat} in a loop.
My dataset looks like this:
> names(OT1);head(OT1);dim(OT1)
[1] "EID" "latitude" "longitude" "month" "year" "CPUE"
"TSUM"
[8] "fTSUM"
EID latitud
5 matches
Mail list logo