Page 1 of 1

[SOLVED] lost locators

PostPosted: Wed Dec 10, 2014 6:23 pm
by RThomas
Hello-

I'm working in RGeostats 10.0.8, and am having problems with losing my locators after I assign them. For example,
data.db<-db.create(hakedata)
db.locate(data.db, c(4,6), loctype="x")

gives

Variables
---------
Field = 1 - Name = rank - Locator = rank
Field = 2 - Name = Transect - Locator = NA
Field = 3 - Name = HakeBiomass - Locator = NA
Field = 4 - Name = HakeBiomassMean - Locator = x1
Field = 5 - Name = HakeLon - Locator = NA
Field = 6 - Name = TransectLength - Locator = x2
Field = 7 - Name = HakeLat - Locator = NA

Great, I can see the locators for the 4th and 6th fields
Now I do
db.locate(data.db, 3,loctype="z")
and I get
Variables
---------
Field = 1 - Name = rank - Locator = rank
Field = 2 - Name = Transect - Locator = NA
Field = 3 - Name = HakeBiomass - Locator = z1
Field = 4 - Name = HakeBiomassMean - Locator = NA
Field = 5 - Name = HakeLon - Locator = NA
Field = 6 - Name = TransectLength - Locator = NA
Field = 7 - Name = HakeLat - Locator = NA

Ulp. I have lost my locators on fields 4 and 6. Do you have any suggestions for how to handle this situation?

Thanks,
Rebecca

Re: lost locators

PostPosted: Thu Dec 11, 2014 9:08 am
by Fabien Ors
Hi Rebecca
The problem is that you have to store the new db returned by db.locate into the current variable data.db
So, call db.locate function like that and it will fix your problem :
Code: Select all
data.db<-db.create(hakedata)
data.db<-db.locate(data.db, c(4,6), loctype="x")
data.db<-db.locate(data.db, 3,loctype="z")

Hope this helps ;-)

Re: lost locators

PostPosted: Thu Dec 11, 2014 10:01 am
by RThomas
Doh!
Thanks for kindly clearing up a pretty silly mistake.

Thanks,
Rebecca