Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
woRkflow
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository 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
Tom Rushby
woRkflow
Commits
f907b9a4
Commit
f907b9a4
authored
4 years ago
by
T.W.Rushby
Browse files
Options
Downloads
Patches
Plain Diff
Fix file paths to work on server.
parent
1c447d8b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
howTo/gisExample.R
+4
-3
4 additions, 3 deletions
howTo/gisExample.R
with
4 additions
and
3 deletions
howTo/gisExample.R
+
4
−
3
View file @
f907b9a4
...
@@ -15,7 +15,8 @@ reqLibs <- c("leaflet",
...
@@ -15,7 +15,8 @@ reqLibs <- c("leaflet",
"drake"
,
# what's done stays done
"drake"
,
# what's done stays done
"here"
,
# here
"here"
,
# here
"lubridate"
,
# dates and times
"lubridate"
,
# dates and times
"bookdown"
# for making reports (should also install knittr etc)
"bookdown"
,
# for making reports (should also install knittr etc)
"htmltools"
)
)
# install/load them
# install/load them
woRkflow
::
loadLibraries
(
reqLibs
)
woRkflow
::
loadLibraries
(
reqLibs
)
...
@@ -25,7 +26,7 @@ woRkflow::loadLibraries(reqLibs)
...
@@ -25,7 +26,7 @@ woRkflow::loadLibraries(reqLibs)
# Set path for geography data
# Set path for geography data
dPathGeo
<-
paste0
(
dPath
,
"geography/census/"
)
dPathGeo
<-
paste0
(
dPath
,
"geography/census/"
)
# Set path for SAVE area-based estimated electricity demand profile data
# Set path for SAVE area-based estimated electricity demand profile data
dPathSAVE
<-
sub
(
"/data"
,
"/SAVE/data"
,
dPath
,
fixed
=
TRUE
)
dPathSAVE
<-
paste0
(
dPath
,
"SAVE/output/GIS/OAstats/"
)
# Load data ----
# Load data ----
...
@@ -112,7 +113,7 @@ st_crs(sf_data) # now CRS shows EPSG: 4326 (what leaflet wants)
...
@@ -112,7 +113,7 @@ st_crs(sf_data) # now CRS shows EPSG: 4326 (what leaflet wants)
# Merge SAVE oa level demand estimates data
# Merge SAVE oa level demand estimates data
# Load file - created by gisDataProcess.Rmd in SAVE project
# Load file - created by gisDataProcess.Rmd in SAVE project
saveOAdata
<-
read.csv
(
paste0
(
dPathSAVE
,
"
output/GIS/OAstats/
gisExportRv2.csv"
),
stringsAsFactors
=
FALSE
)
saveOAdata
<-
read.csv
(
paste0
(
dPathSAVE
,
"gisExportRv2.csv"
),
stringsAsFactors
=
FALSE
)
# Join with output area data
# Join with output area data
saveOAprofiles
<-
left_join
(
saveOAdata
,
sf_data
,
by
=
c
(
"oaCode"
=
"oa11cd"
))
%>%
saveOAprofiles
<-
left_join
(
saveOAdata
,
sf_data
,
by
=
c
(
"oaCode"
=
"oa11cd"
))
%>%
...
...
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