Closed MagnusNordmo closed 4 years ago
Yes, this looks to be an rdrop2
issues and not directly related to mirtCAT
. Can you reproduce this using other types of code, like using just a dummy shiny application? If so I'd recommend opening an issue in rdrop2
; otherwise, if this really just is in mirtCAT then a reproducible example would also be helpful. Thanks.
Unfortunately, I'm too technically inept to help you with this. I wish I could pinpoint the problem further but I can't. All I know is that following the vignette leads to the problem as described.
In contrast, I can use rdrop2 to create save functions that work in dropbox:
library(rdrop2)
outputDir <- "rtest"
saveData <- function(data) {
# Create a unique file name
fileName <- paste0(Sys.time(),".csv")
# Write the data to a temporary file locally
filePath <- file.path(tempdir(), fileName)
write.csv(data, filePath, row.names = FALSE, quote = TRUE)
# Upload the file to Dropbox
drop_upload(filePath, path = outputDir)
}
saveData(mtcars)
Thanks. In your minimum working script though I don't see the use of any token though, which is required to allow access to your Dropbox folder on any given computer (which, if hosting mirtCAT somewhere other than on your local computer, would be required). This is why in my example I had the the first two lines
final_fun <- function(person){
token <- readRDS("droptoken.rds") #read in dropbox token
drop_acc(dtoken = token) #load token
# save final result to dropbox
drop_upload(person, file = Sys.time()) #filename is just the date and time
invisible()
}
On the remote server where the GUI is to be hosted, the droptoken.rds
object is uploaded first so that this is accessible, made active via drop_acc()
so that rdrop2 has access to your personal Dropbox location, and then drop_upload() will work as expected. The error you are seeing looks to be related to supplying and loading a correct token (the issue you reference suggested something similar).
Such a shame as mirtCAT on shiny.io server is a dream combo. Do you know of any way of plotting and/or saving the results ala this from an adaptive mirtCAT_preamble
test?
Such a shame as mirtCAT on shiny.io server is a dream combo.
I don't follow what you mean by this. All you need to supply to shiny.io is a working token for rdrop2
. Are you having difficulty setting up this token so that you can access your Dropbox on a different computer via R?
The link you pointed to is for local storage only, so it only works if you are hosting mirtCAT on a server you have full control over (such as via ssh). mirtCAT can do this already, and is the easiest way to collect data, but requires that you have/know how to manage a Linux server.
My apology for being vague. What I meant was that using mirtCAT on a free shinyapps.io server, and saving the results to a dropbox/googledrive, would be a dream. I've tried to solve the rdrop2
authorization but have not been successful.
Are you having difficulty setting up this token so that you can access your Dropbox on a different computer via R?
I'm not really sure whats going wrong. I can deploy the app but cannot collect data and save it to dropbox. My goal is to be able to send a shinyapp.io link that supplies a mirtCAT test and collects the data.
I guess I should learn to manage a Linux server. Thanks again for you effort.
I took a closer look at my example vignette, and realized something was slightly off with the file uploadding when using rdrop2::drop_upload()
. I've updated the example, so let me know if you have better luck executing the following in your tests.
It works! Thank you for such a great tool and for helping me with this! Shinyapps and mirtCAT really is a great combo!
I have encountered an issue while following the vignette on using dropbox and shiny.io server: http://philchalmers.github.io/mirtCAT/html/shinyApps.html
I cannot seem to get the results to be uploaded. Both when I run it locally and on the shiny server I get the message that: "Warning: Error in drop_upload: is_existing_file : Some or all of the files specified by file do not exist."
I have double checked my dropbox authorization and everything looks in order. Maybe it has something to do with this: https://github.com/karthik/rdrop2/issues/134
Btw, thank you for creating mirtCAT!