You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Radiant is great and we are trying to use it with a new set of data files and our use case requires us to set the file paths relative to getwd() - relative to the Project directory. We need these relative paths because we are pushing the mods we make to our local RStudio-Connect server using the rstudio publishing functions. If we don't we get this error:
"Line 6 Paths should be to files within the project directory."
Line 6 is : ifelse(grepl("radiant", getwd()) && file.exists("../../inst"), "..", system.file(package = "radiant")) %>%
options(radiant.path = .)
How do I configure the radiant paths in radiant/app/global.R so that they are relative to getwd()?
We tried this:
But they we get the following:
Warning in file(filename, "r", encoding = encoding) :
cannot open file 'C:/Users/mszens/Documents/R-git/upstream_discov/radiant/app/radiant.data/app/global.R': No such file or directory ...
Is there a way to set the radiant paths to work within local project directories only?
Thanks so much,
Scot Zens
The text was updated successfully, but these errors were encountered:
All shiny apps use the location of the R-code for the app as the current working directory. It has been some time since I set this up for Radiant and I haven't worked on an Rstudio/Posit Connect setup before.
Can you have the Connect run an application as an individual user? If so, then the settings below could be set in the users local .Rprofile file. It may also be possible to replace /Users/xyz with ~ but I can't test that at the moment.
Might be worth connecting with Rstudio/Posit as well if something like this isn't mentioned in their documentation.
If you find a set up that work, and I'm happy to connect about that more, then please do share the config information back with me so I can add it to the documentation
getOption("radiant.shinyFiles")
[1] TRUE
getOption("radiant.launch_dir")
[1] "/Users/xyz/Dropbox/teaching/CustomerAnalytics/MGT455-2023"
getOption("radiant.sf_volumes") # needs a named list
MGT455-2023
"/Users/xyz/Dropbox/teaching/CustomerAnalytics/MGT455-2023"
Home
"/Users/xyz"
Desktop
"/Users/xyz/Desktop"
Dropbox
"/Users/xyz/Dropbox"
Google Drive
"/Users/xyz/Library/CloudStorage/GoogleDrive-xyz"
Hi,
Radiant is great and we are trying to use it with a new set of data files and our use case requires us to set the file paths relative to getwd() - relative to the Project directory. We need these relative paths because we are pushing the mods we make to our local RStudio-Connect server using the rstudio publishing functions. If we don't we get this error:
"Line 6 Paths should be to files within the project directory."
Line 6 is : ifelse(grepl("radiant", getwd()) && file.exists("../../inst"), "..", system.file(package = "radiant")) %>%
options(radiant.path = .)
How do I configure the radiant paths in radiant/app/global.R so that they are relative to getwd()?
We tried this:
sourcing from radiant.data
options(radiant.path.data = system.file(package = "radiant.data"))
options(radiant.path.data = paste0(getwd(),"/radiant.data"))
source(file.path(getOption("radiant.path.data"), "app/global.R"), encoding = getOption("radiant.encoding", default = "UTF-8"), local = TRUE)
if (getOption("radiant.development", default = FALSE)) {
ifelse(grepl("radiant", getwd()) && file.exists("../../inst"), "..", system.file(package = "radiant")) %>%
ifelse(grepl("radiant", getwd()) && file.exists("../../inst"), "..", paste0(getwd(),"/radiant")) %>%
options(radiant.path = .)
}
...
But they we get the following:
Warning in file(filename, "r", encoding = encoding) :
cannot open file 'C:/Users/mszens/Documents/R-git/upstream_discov/radiant/app/radiant.data/app/global.R': No such file or directory ...
Is there a way to set the radiant paths to work within local project directories only?
Thanks so much,
Scot Zens
The text was updated successfully, but these errors were encountered: