Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OutilEnR_EtatdesLieux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DREAL Grand Est
SCDD
OutilsEnR
OutilEnR_EtatdesLieux
Commits
918b2504
Commit
918b2504
authored
1 year ago
by
guillaume.jeffroy
Browse files
Options
Downloads
Patches
Plain Diff
correction des label dans les table pour cogeneration electrique
parent
96a97cd9
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
R/fct_table.R
+12
-3
12 additions, 3 deletions
R/fct_table.R
with
12 additions
and
3 deletions
R/fct_table.R
+
12
−
3
View file @
918b2504
...
...
@@ -65,8 +65,12 @@ filter_odre_agg <- function(registre_ODRE_agg, sel_epci, sel_filiere, var, var_3
prepare_table
<-
function
(
ODRE_agg_filtered
,
label
){
#affichage nom complets
ODRE_agg_filtered
$
code_typo
<-
ODRE_agg_filtered
$
code_typo
%>%
stringr
::
str_replace_all
(
filiere_labels_select
)
# ODRE_agg_filtered$code_typo <-
# ODRE_agg_filtered$code_typo %>% stringr::str_replace_all(filiere_labels_select)
for
(
key
in
names
(
filiere_labels_select
)){
ODRE_agg_filtered
<-
ODRE_agg_filtered
%>%
mutate
(
code_typo
=
case_when
(
code_typo
==
key
~
filiere_labels_select
[
key
],
T
~
code_typo
))
}
# select, order and cast columns
table
<-
ODRE_agg_filtered
%>%
...
...
@@ -162,6 +166,12 @@ table_options_no_button <- function(nb_elements){
#' @examples
#' prepare_table_obj(objectifs, sel_region = "R44", sel_filiere = c("pvq"))
prepare_table_obj
<-
function
(
objectifs
,
sel_region
,
sel_filiere
)
{
for
(
key
in
names
(
filiere_labels_select
)){
objectifs
<-
objectifs
%>%
mutate
(
code_typo
=
case_when
(
code_typo
==
key
~
filiere_labels_select
[
key
],
T
~
code_typo
))
}
objectifs
%>%
dplyr
::
filter
(
.data
$
code_typo
%in%
sel_filiere
,
paste0
(
"R"
,
.data
$
CodeZone
)
==
sel_region
)
%>%
...
...
@@ -172,7 +182,6 @@ prepare_table_obj <-function(objectifs, sel_region, sel_filiere) {
Zone
=
.data
$
CodeZone
)
%>%
dplyr
::
mutate
(
Énergie
=
factor
(
stringr
::
str_replace_all
(
.data
$
Énergie
,
filiere_labels_select
)),
Zone
=
stringr
::
str_replace_all
(
paste0
(
"R"
,
.data
$
Zone
),
region_names
),
Année
=
factor
(
.data
$
Année
)
)
...
...
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