Page 1 of 1

[SOLVED]mélange entre nom de variable "z_i" et locator "z_j"

PostPosted: Fri Mar 03, 2017 4:25 pm
by bez
a <- db.create(x1=runif(10,0,20),x2=runif(10,0,20),z2 = rep(1,10),z3 = rep(1,10),z4 = rep(1,10),z1 = rep(1,10))
a <- db.locate(a,4:6,"z")
db.plot(a) # represents z2 ==> OK
db.plot(a,name.prop="z2") # represents z3 ==> not OK ; should represent z2

Re: mélange entre nom de variable "z_i" et locator "z_j"

PostPosted: Fri Mar 03, 2017 8:30 pm
by Didier Renard
The reason is obvious.
A field can be defined by one of the following ways:
1) by the field rank
2) by the locator of the field
3) by the name of the field
This definition is performed along the order of the previous list.

Here, the user asks for "name.post=z2".
The algorithm is performed as follows:
- is "z2" a number: NO then this cannot be the field rank
- can "z2" be a locator: YES so the system plots the variable with locator "z2" ... which has the name "z3".

One could be surprised by the name of the argument: 'name.post' which is much more than the "name" of the field.