Page 1 of 1

[SOLVED] Duplicate

PostPosted: Tue Jul 24, 2018 10:09 am
by dimitridor
Hello,

Using duplicate, I get the following error :

Error in data.frame(..., check.names = FALSE) :
arguments imply differing number of rows: 4920, 6767

Hereunder, you'll find the characteristics of my databases. This function was working in a previous version of RGeostats (v11.1). Was there a change in its code in the last version (v11.3) ?

Thank you for your help,

Dimitri

Data Base Characteristics
=========================

Data Base Summary
-----------------
File is organized as a set of isolated points
Space dimension = 2
Number of fields = 6
Maximum Number of attributes = 6
Total number of samples = 4920

Variables
---------
Field = 1 - Name = rank - Locator = rank
Field = 2 - Name = X_L72 - Locator = x1
Field = 3 - Name = Y_L72 - Locator = x2
Field = 4 - Name = argile - Locator = z2
Field = 5 - Name = limon - Locator = NA
Field = 6 - Name = sable - Locator = z1
Browse[2]> target.db

Data Base Characteristics
=========================

Data Base Summary
-----------------
File is organized as a set of isolated points
Space dimension = 2
Number of fields = 3
Maximum Number of attributes = 3
Total number of samples = 6767

Variables
---------
Field = 1 - Name = rank - Locator = rank
Field = 2 - Name = X_L72 - Locator = x1
Field = 3 - Name = Y_L72 - Locator = x2

Re: Duplicate

PostPosted: Tue Jul 24, 2018 9:56 pm
by Didier Renard
Hi Dimitri

Unfortunately, I cannot exhibit such an error on the data sets that I can generate quickly.
I probable need that you send me the two Db (possibly you can save them in ASCII format using db.write) as well as the duplicate syntax ... by mail.

Cheers

Re: Duplicate

PostPosted: Wed Jul 25, 2018 10:08 am
by dimitridor
Hello Didier,

Thanks for your answer.

Here is a sample code producing the error:

nrow=100
c=matrix(nrow=nrow,ncol=3)
c[,1]=runif(nrow)
c[,2]=runif(nrow)
c[,3]=rnorm(nrow)

A=db.create(c)
A=db.locate(A,2:3,"x")
A=db.locate(A,4,"z")

nrow=20
d=matrix(nrow=nrow,ncol=3)
d[,1]=runif(nrow)
d[,2]=runif(nrow)
d[,3]=rnorm(nrow)

d=rbind(d,c[1:20,])

B=db.create(d)
B=db.locate(B,2:3,"x")
B=db.locate(B,4,"z")

X=duplicate(A,B, print=TRUE)

Result:

Error in data.frame(..., check.names = FALSE) :
arguments imply differing number of rows: 100, 40

and db X is not created.

Does it help you to identify the problem?

Dimitri

Re: Duplicate

PostPosted: Sat Jul 28, 2018 4:58 pm
by Didier Renard
Hello Dimitri

I checked with your data set (thanks for providing it). As a matter of fact, you pointed a bug.
The "duplicate" function returns a selection vector that should be added to the SECOND db (not the first one as pretended in the help).
The code had to be fixed in a future release. If you need an urgent version, please let me know.
Thanks
Didier

Re: Duplicate

PostPosted: Mon Jul 30, 2018 3:42 pm
by dimitridor
Hello Didier,

Your answer lets me know the new bug may be linked due to the correction applied after an former bug I posted with the title: "[SOLVED] Erreur de sortie dans duplicate ?"

I need this functionality for a big project with an important deadline in September. I will be on vacation from Friday till around the 20th of August. Is it possible to get the correction these days so that I can continue? Otherwize, having the new version by August 20th will be fine.

Cheers,

Dimitri

Re: Duplicate

PostPosted: Mon Jul 30, 2018 5:44 pm
by Didier Renard
Hi Dimitri

I do not want to publish an official new version now (I am in the process of coding a new neighborhood option). But I can certainly send you a link to a temporary version (that I can easily build for LINUX). If for WINDOWS, we will have to wait for the new official version ... probably early August.

Re: Duplicate

PostPosted: Tue Jul 31, 2018 8:15 am
by dimitridor
Didier,

I'm working on Windows... So, let's wait August for the new version.

Thank you for working on it.

Bests,

Dimitri