Skip to content

Commit

Permalink
DataEditR v0.1.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
DillonHammill committed May 10, 2021
1 parent f0e0945 commit 0f48c9b
Show file tree
Hide file tree
Showing 21 changed files with 66 additions and 32 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: DataEditR
Title: An Interactive Editor for Viewing, Entering, Filtering & Editing Data
Version: 0.1.0
Date: 2020-12-17
Version: 0.1.1
Date: 2021-05-10
Authors@R:
person(given = "Dillon",
family = "Hammill",
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# DataEditR 0.1.1

* Ensure `dataInput()` searches for data outside `data_edit()`.
* Prevent loading of highlighted data object in RStudio when data has been supplied to `data_edit()` directly.

# DataEditR 0.1.0

* Make the switch to GitHub Actions for continuous integration.
Expand Down
8 changes: 6 additions & 2 deletions R/dataInput.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#' \code{read_fun} when reading in files.
#' @param hide logical indicating whether the data input user interface should
#' be hidden from the user, set to FALSE by default.
#' @param envir the environment in which to search for the supplied data, set to
#' the \code{parent.frame()} of \code{dataInput} by default.
#'
#' @importFrom shiny fluidRow splitLayout textInput fileInput NS moduleServer
#' reactive updateTextInput observeEvent eventReactive
Expand Down Expand Up @@ -89,7 +91,8 @@ dataInputServer <- function(id,
data = NULL,
read_fun = "read.csv",
read_args = NULL,
hide = FALSE) {
hide = FALSE,
envir = parent.frame()) {

# SERVER
moduleServer(id, function(input,
Expand Down Expand Up @@ -148,7 +151,8 @@ dataInputServer <- function(id,
# DATA INPUT
data_input <- eventReactive(input$data, {
tryCatch(
eval(parse(text = input$data)),
eval(parse(text = input$data),
envir = envir),
error = function(e) {
return(NULL)
}
Expand Down
10 changes: 8 additions & 2 deletions R/data_edit.R
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,16 @@ data_edit <- function(x = NULL,
code = FALSE,
...) {

# DATA ENVIRONMENT -----------------------------------------------------------

# SEARCH DATA OUTSIDE DATA_EDIT
envir <- parent.frame()

# PREPARE DATA ---------------------------------------------------------------

# RSTUDIO ADDIN/DATA
context <- getActiveDocumentContext()
if(nzchar(context$selection[[1]]$text)) {
if(is.null(x) & nzchar(context$selection[[1]]$text)) {
data <- context$selection[[1]]$text
} else {
if(!is.null(dim(x))) {
Expand Down Expand Up @@ -280,7 +285,8 @@ data_edit <- function(x = NULL,
data = data,
read_fun = read_fun,
read_args = read_args,
hide = hide)
hide = hide,
envir = envir) # search in parent frame

# RESET FILTERS
observeEvent(data_input(), {
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,17 @@ citation("DataEditR")
#>
#> To cite package 'DataEditR' in publications use:
#>
#> Dillon Hammill (2020). DataEditR: An Interactive Editor for Viewing,
#> Entering, Filtering & Editing Data. R package version 0.1.0.
#> Dillon Hammill (2021). DataEditR: An Interactive Editor for Viewing,
#> Entering, Filtering & Editing Data. R package version 0.1.1.
#> https://github.com/DillonHammill/DataEditR
#>
#> A BibTeX entry for LaTeX users is
#>
#> @Manual{,
#> title = {DataEditR: An Interactive Editor for Viewing, Entering, Filtering & Editing Data},
#> author = {Dillon Hammill},
#> year = {2020},
#> note = {R package version 0.1.0},
#> year = {2021},
#> note = {R package version 0.1.1},
#> url = {https://github.com/DillonHammill/DataEditR},
#> }
```
2 changes: 1 addition & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/CODE_OF_CONDUCT.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/DataEditR.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions docs/news/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ pkgdown: 1.6.1
pkgdown_sha: ~
articles:
DataEditR: DataEditR.html
last_built: 2020-12-17T06:38Z
last_built: 2021-05-10T03:12Z

2 changes: 1 addition & 1 deletion docs/reference/dataEdit.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/dataFilter.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions docs/reference/dataInput.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/dataOutput.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/dataSelect.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/data_edit.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion man/dataInput.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0f48c9b

Please sign in to comment.