DillonHammill / DataEditR

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

Loading Data from Within a Function #18

Closed DillonHammill closed 3 years ago

DillonHammill commented 3 years ago

Looks like there are some environment issue with dataInput() when data_edit() is called inside another function. For example, no data is displayed with the following:

data_test <- function(){
  data <- mtcars
  data_edit(data)
}

I suspect this is because dataInput is searching for data in the wrong environment. I will need to set the search environment to the parent.frame() of data_edit() in order for this to work.

DillonHammill commented 3 years ago

Above mentioned changes have been implemented in DataEditR v0.1.1, in addition to preventing loading of highlighted objects in RStudio when data ahs been supplied directly to data_edit().