DillonHammill / DataEditR

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

Changing row name crashes shiny #1

Closed Robinlovelace closed 4 years ago

Robinlovelace commented 4 years ago

Try creating a duplicate row name to reproduce. Output:

open_toos_new = DataEditR::data_edit(open_tools)
Warning: non-unique value when setting 'row.names': ‘4’
Warning: Error in .rowNamesDF<-: duplicate 'row.names' are not allowed
  78: stop
  77: .rowNamesDF<-
  76: row.names<-.data.frame
  74: rownames<-
  73: observeEventHandler
   2: runApp
   1: DataEditR::data_edit
DillonHammill commented 4 years ago

@Robinlovelace, thanks for trying DataEditR!

The row indices are not supposed to be edited by the user as they are not exported in the returned data. Regardless, I have just pushed an update to make sure that the row indices are unique internally, which should prevent the data editor from crashing.

I also added an update to ensure that the row indices are in the correct order when rows are added or removed. This should help to remove the need to edit these values manually.

Please pull down the latest version and let me know if the crashing issue is resolved:

devtools::install_github("DillonHammill/DataEditR")
Robinlovelace commented 4 years ago

Confirmed, that's fixed. I raised the issue to reduce the probability of users accidentally crashing the app. Mission accomplished!

One question raised on Twitter: is there a way to get code output for modifying the data frame?