Skip to content

Commit

Permalink
add set_names
Browse files Browse the repository at this point in the history
  • Loading branch information
tonygard-indecon committed Nov 8, 2023
1 parent 40ca9fa commit d8c3bac
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
6 changes: 2 additions & 4 deletions R/configTests.R
Original file line number Diff line number Diff line change
Expand Up @@ -738,8 +738,6 @@ make_scaled_impact_plots <- function(
theme = NULL
)
){
###### Get from FrEDI Namespace ######
addListNames <- utils::getFromNamespace("addListNames", "FrEDI")

### Other values
# years <- c("NA", "2010", "2090")
Expand Down Expand Up @@ -795,12 +793,12 @@ make_scaled_impact_plots <- function(
})
### Add names
labels_x <- types_x[["label"]]
list_x <- list_x |> addListNames(labels_x)
list_x <- list_x |> set_names(labels_x)
### Return
return(list_x)
})
### Add names
list0 <- list0 |> addListNames(models)
list0 <- list0 |> set_names(models)
### Return
return(list0)
} ### End plot_DoW_by_sector
Expand Down
12 changes: 5 additions & 7 deletions R/configTests_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,7 @@ create_scaledImpact_plot <- function(

###### Get from FrEDI Namespace ######
get_colScale <- utils::getFromNamespace("get_colScale", "FrEDI")
addListNames <- utils::getFromNamespace("addListNames", "FrEDI")


###### Data ######
df0 <- data |> filter(sector == sector0)
df0 <- df0 |> filter(impactType == impType0)
Expand Down Expand Up @@ -527,8 +526,7 @@ create_scaledImpact_plots <- function(

###### Get from FrEDI Namespace ######
get_colScale <- utils::getFromNamespace("get_colScale", "FrEDI")
addListNames <- utils::getFromNamespace("addListNames", "FrEDI")


###### Format Data ######
### Filter to sector and convert to data frame
# data |> glimpse()
Expand Down Expand Up @@ -792,7 +790,7 @@ create_scaledImpact_plots <- function(

### Name the plots
# listTypes_j |> length() |> print(); cImpTypes |> print()
listTypes_j <- listTypes_j |> addListNames(cImpTypes)
listTypes_j <- listTypes_j |> set_names(cImpTypes)

### Arrange plot list
# plotGrid_j <- ggarrange(plotlist=listTypes_j, ncol=1, nrow=nRow, common.legend=F, legend="none")
Expand Down Expand Up @@ -830,11 +828,11 @@ create_scaledImpact_plots <- function(
return(plotGrid_j)
})
### Name the plots
listYears0 <- listYears0 |> addListNames(cImpYears)
listYears0 <- listYears0 |> set_names(cImpYears)
return(listYears0)
}) ### End iter1_i
### Name the plots
listIter1 <- listIter1 |> addListNames(cIter1)
listIter1 <- listIter1 |> set_names(cIter1)

###### Return ######
### Return the plot
Expand Down
1 change: 1 addition & 0 deletions R/createSystemData.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ createSystemData <- function(
return = TRUE,
byState = FALSE
){

###### Set up the environment ######
### Level of messaging (default is to message the user) and save behavior
msgUser <- !silent
Expand Down

0 comments on commit d8c3bac

Please sign in to comment.