Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
Mapping with R
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SERG
Mapping with R
Commits
38fa9d5b
Commit
38fa9d5b
authored
2 years ago
by
Tom Rushby
Browse files
Options
Downloads
Patches
Plain Diff
Initial commit.
parent
18a57610
No related branches found
No related tags found
1 merge request
!6
Update to include Rushmoor local authority area in Hampshire (previously missing)
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
env.R
+48
-0
48 additions, 0 deletions
env.R
with
48 additions
and
0 deletions
env.R
0 → 100644
+
48
−
0
View file @
38fa9d5b
# parameters widely re-used across this repo
repoParams
<-
list
()
# params holder as a list
listFiles
<-
FALSE
# Location ----
# attempt to guess the platform & user
repoParams
$
info
<-
Sys.info
()
repoParams
$
sysname
<-
repoParams
$
info
[[
1
]]
repoParams
$
nodename
<-
repoParams
$
info
[[
4
]]
repoParams
$
login
<-
repoParams
$
info
[[
6
]]
repoParams
$
user
<-
repoParams
$
info
[[
7
]]
# Base Data path ----
dLoc
<-
"unknown - find this line in env.R and fix it!"
if
(
repoParams
$
sysname
==
"Darwin"
)
{
# we're on a Mac (local) so we can set the data path to the Resource drive (if mounted)
dLoc
<-
"/Volumes/Resource/CivilEnvResearch/Public/SERG/data/"
}
if
(
repoParams
$
sysname
==
"Windows"
)
{
# we're on Windows (local) so we can set the data path to J: drive (if mounted)
dLoc
<-
"J:/CivilEnvResearch/Public/SERG/data/"
}
if
(
repoParams
$
nodename
==
"srv02405"
)
{
# we're on the UoS RStudio server so we set the data path to:
dLoc
<-
path.expand
(
"/mnt/SERG_data/"
)
}
if
(
grepl
(
"prd-cls2k4"
,
repoParams
$
nodename
))
{
# we're on the UoS SVE so we can set the output path to J: (as mounted)
dLoc
<-
"J:/CivilEnvResearch/Public/SERG/data/"
}
# Data (SSEN) ----
dPath
<-
paste0
(
dLoc
,
"geography/"
)
### Output ----
outPath
<-
paste0
(
dLoc
,
"geography/export/"
)
# Feedback ----
message
(
"You're "
,
repoParams
$
user
,
" using "
,
repoParams
$
sysname
,
" on "
,
repoParams
$
nodename
)
message
(
"Default dPath has been set to: \n"
,
dPath
)
if
(
listFiles
)
{
# optional
message
(
"and these are the files/folders in that dPath:"
)
print
(
try
(
list.files
(
dPath
)))
# in case it breaks
}
message
(
"Check env.R if that's not what you expected..."
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment