Skip to content
Snippets Groups Projects
Commit feadc1fb authored by B.Anderson's avatar B.Anderson
Browse files

added code to set J: drive SERG 'public' data mount point as dPath and (optionally) list the files

parent a6e6f54c
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
# here's why a project level .Rprofile should not be used for this job https://support.rstudio.com/hc/en-us/articles/360047157094-Managing-R-with-Rprofile-Renviron-Rprofile-site-Renviron-site-rsession-conf-and-repos-conf # here's why a project level .Rprofile should not be used for this job https://support.rstudio.com/hc/en-us/articles/360047157094-Managing-R-with-Rprofile-Renviron-Rprofile-site-Renviron-site-rsession-conf-and-repos-conf
repoParams <- list() # params holder as a list. Sooooo much easier with tab complete repoParams <- list() # params holder as a list. Sooooo much easier with tab complete
listFiles <- TRUE
# Location ---- # Location ----
# attempt to guess the platform & user # attempt to guess the platform & user
...@@ -11,5 +12,18 @@ repoParams$nodename <- repoParams$info[[4]] ...@@ -11,5 +12,18 @@ repoParams$nodename <- repoParams$info[[4]]
repoParams$login <- repoParams$info[[6]] repoParams$login <- repoParams$info[[6]]
repoParams$user <- repoParams$info[[7]] repoParams$user <- repoParams$info[[7]]
# use this guess to set a data path
# default
dPath <- "unkown - fix your code!"
if (repoParams$nodename == "srv02405") {
# we're on the UoS RStudio server so we can set the data path to J: (as mounted)
dPath <- path.expand("/mnt/SERG_data/")
}
message("You're ", repoParams$user, " using " , repoParams$sysname, " on ", repoParams$nodename) message("You're ", repoParams$user, " using " , repoParams$sysname, " on ", repoParams$nodename)
message("Default dPath has been set to: ", dPath)
if (listFiles) { # optional
message("and these are the files/folders in that dPath")
try(list.files(dPath)) # in case it breaks
}
message("Hopefully that's what you expected...") message("Hopefully that's what you expected...")
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment