DillonHammill / DataEditR

An Interactive R Package for Viewing, Entering Filtering and Editing Data
https://dillonhammill.github.io/DataEditR/
381 stars 40 forks source link

data_edit not saving edits #71

Open cmbarton opened 2 months ago

cmbarton commented 2 months ago

I recently installed DataEditR and went to try it today. It is not working. The RStudio addin is not launching correctly (I'll add a different issue for that) and when I open a data.frame with data_edit() it does not save the edits.

I'm using R 4.4.1 (2024-06-14) and RStudio Version 2024.04.2+764 (2024.04.2+764) with MacOS 14.5 (ARM) I had no errors installing DataEditR or launching it.

Here is what happens.

  1. I make a copy of mtcars to test

    mtc_new <- mtcars
  2. I open it with data_edit and make a change

  3. Edit the last column ("carb") of row one, changing it from 4 to 5

  4. Tab to a new line just to make sure the change sticks

  5. Click done

data_edit(mtc_new)

Listening on http://127.0.0.1:3739
> mtc_new
                     mpg cyl  disp  hp drat    wt  qsec vs am gear carb
Mazda RX4           21.0   6 160.0 110 3.90 2.620 16.46  0  1    4    4
Mazda RX4 Wag       21.0   6 160.0 110 3.90 2.875 17.02  0  1    4    4
Datsun 710          22.8   4 108.0  93 3.85 2.320 18.61  1  1    4    1
Hornet 4 Drive      21.4   6 258.0 110 3.08 3.215 19.44  1  0    3    1

I tried the same thing with the syntax to use edit()

mtc_new <- data_edit(mtc_new)

Same result. No change.

fornaeffe commented 1 week ago

Same for me, but if I click "synchronize" before "Done", it returns correctly the edited data. I think it is an unintuitive behavior, I think it would be better if clicking "Done" will return the edited data always, without the need to click "synchronize" before.

cmbarton commented 1 week ago

Just tested with your work around and it seems to work. Thanks. Indeed unintuitive. But at least it works.