Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Lars Dalby
almass
Commits
7bc2ec95
Commit
7bc2ec95
authored
Jan 29, 2019
by
LDalby
Browse files
Fix header names
parent
f285bf42
Changes
1
Hide whitespace changes
Inline
Side-by-side
Grendel/collect-results-scenario_02.R
View file @
7bc2ec95
...
@@ -27,7 +27,7 @@ path(path_to_dirs, glue::glue("WD{suffix}"), "Results", file_name) %>%
...
@@ -27,7 +27,7 @@ path(path_to_dirs, glue::glue("WD{suffix}"), "Results", file_name) %>%
wd
=
glue
::
glue
(
"WD{suffix}"
))
%>%
wd
=
glue
::
glue
(
"WD{suffix}"
))
%>%
dplyr
::
mutate
(
file_contents
=
future_map
(
file_name
,
~
data.table
::
fread
(
file
=
.
)))
%>%
dplyr
::
mutate
(
file_contents
=
future_map
(
file_name
,
~
data.table
::
fread
(
file
=
.
)))
%>%
tidyr
::
unnest
()
%>%
tidyr
::
unnest
()
%>%
purrr
::
set_names
(
c
(
"file_name"
,
"wd"
,
"season"
,
"day"
,
"pinkfoot"
,
"pinkfoot_dist"
,
purrr
::
set_names
(
nm
=
c
(
"file_name"
,
"wd"
,
"season"
,
"day"
,
"pinkfoot"
,
"pinkfoot_dist"
,
"barnacle"
,
"barnacle_dist"
,
"greylag"
,
"greylag_dist"
,
"barnacle"
,
"barnacle_dist"
,
"greylag"
,
"greylag_dist"
,
"grain"
,
"maize"
,
"polyref"
,
"param"
,
"value"
))
->
all_res
"grain"
,
"maize"
,
"polyref"
,
"param"
,
"value"
))
->
all_res
...
@@ -37,15 +37,14 @@ path(path_to_dirs, glue::glue("WD{suffix}"), "Results", grain_file_name) %>%
...
@@ -37,15 +37,14 @@ path(path_to_dirs, glue::glue("WD{suffix}"), "Results", grain_file_name) %>%
wd
=
glue
::
glue
(
"WD{suffix}"
))
%>%
wd
=
glue
::
glue
(
"WD{suffix}"
))
%>%
dplyr
::
mutate
(
file_contents
=
future_map
(
file_name
,
~
data.table
::
fread
(
file
=
.
)))
%>%
dplyr
::
mutate
(
file_contents
=
future_map
(
file_name
,
~
data.table
::
fread
(
file
=
.
)))
%>%
tidyr
::
unnest
()
%>%
tidyr
::
unnest
()
%>%
purrr
::
set_names
(
c
(
"season"
,
"grain_dist"
,
"param"
,
"value"
))
->
all_grain
purrr
::
set_names
(
nm
=
c
(
"file_name"
,
"wd"
,
"season"
,
"grain_dist"
,
"param"
,
"value"
))
->
all_grain
rotation_file_name
<-
"scenario-rotations.txt"
rotation_file_name
<-
"scenario-rotations.txt"
path
(
path_to_dirs
,
glue
::
glue
(
"WD{suffix}"
),
rotation_file_name
)
%>%
path
(
path_to_dirs
,
glue
::
glue
(
"WD{suffix}"
),
rotation_file_name
)
%>%
tibble
::
tibble
(
file_name
=
.
,
tibble
::
tibble
(
file_name
=
.
)
%>%
wd
=
glue
::
glue
(
"WD{suffix}"
))
%>%
dplyr
::
mutate
(
file_contents
=
future_map
(
file_name
,
~
data.table
::
fread
(
file
=
.
)))
%>%
dplyr
::
mutate
(
file_contents
=
future_map
(
file_name
,
~
data.table
::
fread
(
file
=
.
)))
%>%
tidyr
::
unnest
()
%>%
tidyr
::
unnest
()
%>%
purrr
::
set_names
(
c
(
"wd"
,
"rotation"
))
->
all_rotation
purrr
::
set_names
(
c
(
"file_name"
,
"wd"
,
"rotation"
))
->
all_rotation
numbers_file_name
<-
"scenario-goose-numbers.txt"
numbers_file_name
<-
"scenario-goose-numbers.txt"
path
(
path_to_dirs
,
glue
::
glue
(
"WD{suffix}"
),
"Results"
,
numbers_file_name
)
%>%
path
(
path_to_dirs
,
glue
::
glue
(
"WD{suffix}"
),
"Results"
,
numbers_file_name
)
%>%
...
@@ -53,7 +52,7 @@ path(path_to_dirs, glue::glue("WD{suffix}"), "Results", numbers_file_name) %>%
...
@@ -53,7 +52,7 @@ path(path_to_dirs, glue::glue("WD{suffix}"), "Results", numbers_file_name) %>%
wd
=
glue
::
glue
(
"WD{suffix}"
))
%>%
wd
=
glue
::
glue
(
"WD{suffix}"
))
%>%
dplyr
::
mutate
(
file_contents
=
future_map
(
file_name
,
~
data.table
::
fread
(
file
=
.
)))
%>%
dplyr
::
mutate
(
file_contents
=
future_map
(
file_name
,
~
data.table
::
fread
(
file
=
.
)))
%>%
tidyr
::
unnest
()
%>%
tidyr
::
unnest
()
%>%
purrr
::
set_names
(
c
(
"season"
,
"day"
,
"pf_families"
,
"pf_non_breeders"
,
"bn_families"
,
purrr
::
set_names
(
nm
=
c
(
"file_name"
,
"wd"
,
"season"
,
"day"
,
"pf_families"
,
"pf_non_breeders"
,
"bn_families"
,
"bn_non_breeders"
,
"gl_families"
,
"gl_non_breeders"
,
"snow_depth"
,
"bn_non_breeders"
,
"gl_families"
,
"gl_non_breeders"
,
"snow_depth"
,
"param"
,
"value"
))
->
all_numbers
"param"
,
"value"
))
->
all_numbers
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment