Skip to content

Commit

Permalink
fix: download file via tempfile
Browse files Browse the repository at this point in the history
close #91
  • Loading branch information
jhk0530 committed Nov 12, 2023
1 parent 4f3c2cb commit feef1de
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: door
Title: Shiny module for statgarten
Version: 0.4.2
Version: 0.4.3
Authors@R:
person("Jinhwan", "Kim", , "[email protected]", role = c("cre", "aut"))
Description: Main application for data analysis using statgarten packages.
Expand Down
8 changes: 4 additions & 4 deletions R/app_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -689,16 +689,16 @@ app_server <- function(input, output, session) {
# datatoy load data
observeEvent(input$loadExample, {
githubURL <- paste0("https://github.com/statgarten/datatoys/raw/main/data/", input$datatoy, ".rda")
download.file(githubURL, "/tmp/temp.Rda")
load("/tmp/temp.Rda")
file.remove("/tmp/temp.Rda")
datatoyFile <- tempfile()
download.file(githubURL, datatoyFile)
load(datatoyFile)
unlink(datatoyFile)

eval(parse(text = paste0("data_rv$data <- ", input$datatoy)))
eval(parse(text = paste0("data_rv$name <- '", input$datatoy, "'")))
inputData(data_rv$data)
})


# Data loaded
observeEvent(data_rv$data, {
inputData(data_rv$data) # set data
Expand Down

0 comments on commit feef1de

Please sign in to comment.