IDEMSInternational / R-Instat

A statistics software package powered by R
http://r-instat.org/
GNU General Public License v3.0
38 stars 103 forks source link

Simplify the Prepare > Data Frame > Add (Merge) Data dialogue when possible #7777

Open rdstern opened 2 years ago

rdstern commented 2 years ago

Here is an example to show what I would like.

File > New Data Frame > Lists > Maths > Primes Then File > New Data Frame > Lists > Maths > Binary Primes Now add a row variable to each data frame - making it a key variable (uses Prepare >Data Frame > Row Numbers/Names dialogue. Now I would like to add the binary primes variable to the primes data frame.

image

a) Notice all variables are there, and I have to use the sub-dialogue to get rid of them all except the row variable. (That's annoyingly complicated.)

I suggest that if the From data frame has a single key variable and the other data frame has a variable of the same name (here the name row), then that's the only linking variable that is suggested. And that's what is needed here.

b) There is a second problem with the dialogue using this example. I just wanted to copy the variable called list, into the primes data frame. But there is already a copy with that name. It has (correctly) given it a different name, but has also (incorrectly) added a further copy of the primes itself.

I assume @N-thony for this, or he may propose someone else.

N-thony commented 2 years ago

@derekagorhom can you try this? Let me know if you have any problem.

derekagorhom commented 2 years ago

Hello Antoine, please i will need you help in fixing issue #7777, first is with the ucrFromDataFrame, when changing the setdatatype its now does not display any of the data types for the dataset.

N-thony commented 2 years ago

@rdstern on item b) I think it is because we are using data_book$add_columns_to_data(data_name="primes", col_data=primes) and this is adding the column in the primes dataset, it overwrites if it find the same columns.

image

N-thony commented 2 years ago

Here is an example to show what I would like.

File > New Data Frame > Lists > Maths > Primes Then File > New Data Frame > Lists > Maths > Binary Primes Now add a row variable to each data frame - making it a key variable (uses Prepare >Data Frame > Row Numbers/Names dialogue. Now I would like to add the binary primes variable to the primes data frame.

image

a) Notice all variables are there, and I have to use the sub-dialogue to get rid of them all except the row variable. (That's annoyingly complicated.)

I suggest that if the From data frame has a single key variable and the other data frame has a variable of the same name (here the name row), then that's the only linking variable that is suggested. And that's what is needed here.

b) There is a second problem with the dialogue using this example. I just wanted to copy the variable called list, into the primes data frame. But there is already a copy with that name. It has (correctly) given it a different name, but has also (incorrectly) added a further copy of the primes itself.

I assume @N-thony for this, or he may propose someone else.

@derekagorhom I fixed item b) please fix item a)

rdstern commented 2 years ago

@N-thony I tried this and got this error:

image

N-thony commented 1 year ago

@N-thony I tried this and got this error:

image @rdstern this is now fixed.