Skip to content

Commit 01ed697

Browse files
Merge pull request #4 from DeepWaterIMR/copilot/fix-axis-label-issue
Replace tidyselect::all_of with !! operator in dplyr::rename operations
2 parents 3f9ef42 + ecda6bf commit 01ed697

5 files changed

Lines changed: 13 additions & 13 deletions

File tree

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Description: Contains functions to create life history parameter plots from raw
1515
collection of packages. The package contains references to FishBase
1616
(Froese R., Pauly D., 2023) <https://www.fishbase.se/>.
1717
Depends: R (>= 3.5.0), ggplot2 (>= 3.4.0)
18-
Imports: dplyr, tibble, tidyr, ggridges (>= 0.5.0), fishmethods, broom, tidyselect,
18+
Imports: dplyr, tibble, tidyr, ggridges (>= 0.5.0), fishmethods, broom,
1919
magrittr, ggrepel, scales, purrr
2020
Suggests: knitr, rmarkdown
2121
License: GPL-3

R/plot_catchcurve.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ plot_catchcurve <- function(
122122
## Select and rename columns ####
123123

124124
dt <- dt %>%
125-
dplyr::rename("age" = tidyselect::all_of(age)) %>%
125+
dplyr::rename("age" = !!age) %>%
126126
dplyr::filter(!is.na(age)) %>%
127127
dplyr::mutate(age = as.numeric(age))
128128

@@ -137,13 +137,13 @@ plot_catchcurve <- function(
137137

138138
if (is.null(time)) {
139139
dt <- dt %>%
140-
dplyr::rename("sex" = tidyselect::all_of(sex)) %>%
140+
dplyr::rename("sex" = !!sex) %>%
141141
dplyr::filter(!is.na(sex)) %>%
142142
dplyr::group_by(sex, age) %>%
143143
dplyr::count()
144144
} else {
145145
dt <- dt %>%
146-
dplyr::rename("sex" = tidyselect::all_of(sex)) %>%
146+
dplyr::rename("sex" = !!sex) %>%
147147
dplyr::filter(!is.na(sex)) %>%
148148
dplyr::group_by(time = get(time), sex, age) %>%
149149
dplyr::count()

R/plot_growth.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ plot_growth <- function(
9292
orig.nrow <- nrow(dt)
9393

9494
dt <- dt %>%
95-
dplyr::rename("sex" = tidyselect::all_of(sex)) %>%
95+
dplyr::rename("sex" = !!sex) %>%
9696
dplyr::filter(!is.na(sex))
9797

9898
sex.missing <- orig.nrow - nrow(dt)
@@ -106,8 +106,8 @@ plot_growth <- function(
106106

107107
dt <- dt %>%
108108
dplyr::rename(
109-
"age" = tidyselect::all_of(age),
110-
"length" = tidyselect::all_of(length)
109+
"age" = !!age,
110+
"length" = !!length
111111
)
112112

113113
length.missing <- sum(is.na(dt$length))

R/plot_lw.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ plot_lw <- function(
105105
orig.nrow <- nrow(dt)
106106

107107
dt <- dt %>%
108-
dplyr::rename("sex" = tidyselect::all_of(sex)) %>%
108+
dplyr::rename("sex" = !!sex) %>%
109109
dplyr::filter(!is.na(sex))
110110

111111
sex.missing <- orig.nrow - nrow(dt)
@@ -119,8 +119,8 @@ plot_lw <- function(
119119

120120
dt <- dt %>%
121121
dplyr::rename(
122-
"weight" = tidyselect::all_of(weight),
123-
"length" = tidyselect::all_of(length)
122+
"weight" = !!weight,
123+
"length" = !!length
124124
)
125125

126126
length.missing <- sum(is.na(dt$length))

R/plot_maturity.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ plot_maturity <- function(
137137

138138
dt <- dt %>%
139139
dplyr::rename(
140-
"maturity" = tidyselect::all_of(maturity),
141-
"length" = tidyselect::all_of(length)
140+
"maturity" = !!maturity,
141+
"length" = !!length
142142
) %>%
143143
dplyr::filter(
144144
!is.na(maturity) &
@@ -156,7 +156,7 @@ plot_maturity <- function(
156156
}
157157

158158
dt <- dt %>%
159-
dplyr::rename("sex" = tidyselect::all_of(sex)) %>%
159+
dplyr::rename("sex" = !!sex) %>%
160160
dplyr::filter(!is.na(sex)) %>%
161161
dplyr::select(length, sex, maturity)
162162

0 commit comments

Comments
 (0)