Skip to content

Commit

Permalink
lint r code
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyhanson committed Jul 20, 2021
1 parent 31b9e27 commit 035f015
Show file tree
Hide file tree
Showing 199 changed files with 2,451 additions and 1,756 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ pkgdown
.dockerignore
Dockerfile
docker-compose.yml
.lintr
9 changes: 9 additions & 0 deletions .lintr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
linters: with_defaults(
object_name_linter = NULL,
camel_case_linter = NULL,
closed_curly_linter = NULL,
cyclocomp_linter = NULL,
open_curly_linter = NULL,
todo_comment_linter = NULL,
undesirable_operator_linter = NULL
)
14 changes: 10 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
Package: wheretowork
Title: Systematic conservation planning application
Title: Interactive systematic conservation planning application
Version: 0.0.0.9000
Description:
Interactive application for systematic conservation planning
Launch an interactive web application for systematic conservation planning.
Data can be accessed using projects available on disk, uploaded using
project files, or uploaded in shapefile format. Prioritizations are
generated using mixed integer programming techniques. The performance of
candidate prioritizations can be examined using summary statistics,
interactive charts, and tables. Finally, data and prioritizations can also
be downloaded for subsequent analysis.
Authors@R: c(
person(c('Jeffrey', 'O'), 'Hanson',
email='[email protected]', role = c('aut', 'cre'),
Expand Down Expand Up @@ -107,8 +113,8 @@ Collate:
'class_Statistic.R'
'class_WeightResults.R'
'fct_find_projects.R'
'fct_generate_min_set_solution.R'
'fct_generate_min_shortfall_solution.R'
'fct_min_set_solution.R'
'fct_min_shortfall_solution.R'
'fct_read_project.R'
'fct_simulate_includes.R'
'fct_simulate_legends.R'
Expand Down
4 changes: 2 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ export(error_message)
export(exportSidebarPane)
export(extract_data_matrix)
export(find_projects)
export(generate_min_set_solution)
export(generate_min_shortfall_solution)
export(get_golem_config)
export(horizontalPickerInput)
export(importModal)
Expand All @@ -45,6 +43,8 @@ export(leaflet_map)
export(mapManager)
export(mapManagerOutput)
export(mapManagerSidebarPane)
export(min_set_solution)
export(min_shortfall_solution)
export(newSolutionSidebarPane)
export(new_categorical_legend)
export(new_continuous_legend)
Expand Down
23 changes: 11 additions & 12 deletions R/app_config.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#'
#' NOTE: If you manually change your package name in the DESCRIPTION,
#' don't forget to change it here too, and in the config file.
#' For a safer name change mechanism, use the `golem::set_golem_name()` function.
#' For a safer name change mechanism, use the `golem::set_golem_name()`
#' function.
#'
#' @param ... character vectors, specifying subdirectory and file(s)
#' within your package. The default, none, returns the root of the app.
Expand All @@ -20,17 +21,15 @@ app_sys <- function(...) {
#' @param use_parent Logical, scan the parent directory for config file.
#'
#' @export
get_golem_config <- function(
value,
config = Sys.getenv(
"GOLEM_CONFIG_ACTIVE",
Sys.getenv(
"R_CONFIG_ACTIVE",
"default"
)
),
use_parent = TRUE
){
get_golem_config <- function(value,
config = Sys.getenv(
"GOLEM_CONFIG_ACTIVE",
Sys.getenv(
"R_CONFIG_ACTIVE",
"default"
)
),
use_parent = TRUE) {
config::get(
value = value,
config = config,
Expand Down
2 changes: 1 addition & 1 deletion R/app_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' @param input,output,session Internal parameters for {shiny}.
#' DO NOT REMOVE.
#' @noRd
app_server <- function(input, output, session ) {
app_server <- function(input, output, session) {

# initialization
## initialize app
Expand Down
7 changes: 3 additions & 4 deletions R/app_ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ app_ui <- function(request) {
# app content
shiny::fillPage(

## manually insert shinyBS JS code
htmltools::tags$script(src = "www/shinyBS-copy.js"),
## manually insert shinyBS JS code
htmltools::tags$script(src = "www/shinyBS-copy.js"),

## start up screen
shinybusy::busy_start_up(
Expand Down Expand Up @@ -51,7 +51,6 @@ app_ui <- function(request) {
newSolutionSidebarPane(id = "newSolutionPane"),
solutionResultsSidebarPane(id = "solutionResultsPane")
)

)
)
}
Expand All @@ -63,7 +62,7 @@ app_ui <- function(request) {
#'
#' @importFrom golem add_resource_path activate_js favicon bundle_resources
#' @noRd
golem_add_external_resources <- function(){
golem_add_external_resources <- function() {
# add resources
golem::add_resource_path(
"www", app_sys("app/www")
Expand Down
4 changes: 2 additions & 2 deletions R/class_CategoricalLegend.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ CategoricalLegend <- R6::R6Class(
is.character(colors),
assertthat::noNA(colors),
all(nchar(colors) %in% c(7, 9)),
all(substr(colors, 1, 1) == "#"))
all(substr(colors, 1, 1) == "#")
)
self$values <- values
self$colors <- colors
},
Expand Down Expand Up @@ -91,7 +92,6 @@ CategoricalLegend <- R6::R6Class(
#'
#' # print object
#' print(l)
#'
#' @export
new_categorical_legend <- function(values, colors) {
CategoricalLegend$new(values = values, colors)
Expand Down
8 changes: 4 additions & 4 deletions R/class_ContinuousLegend.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ ContinuousLegend <- R6::R6Class(
is.character(colors),
assertthat::noNA(min_value),
all(nchar(colors) %in% c(7, 9)),
all(substr(colors, 1, 1) == "#"))
all(substr(colors, 1, 1) == "#")
)
self$min_value <- min_value
self$max_value <- max_value
self$colors <- colors
Expand Down Expand Up @@ -93,7 +94,6 @@ ContinuousLegend <- R6::R6Class(
colors = self$colors
)
}

)
)

Expand All @@ -120,9 +120,9 @@ ContinuousLegend <- R6::R6Class(
#'
#' # print object
#' print(l)
#'
#' @export
new_continuous_legend <- function(min_value, max_value, colors, n = 4) {
ContinuousLegend$new(
min_value = min_value, max_value = max_value, colors = colors, n = n)
min_value = min_value, max_value = max_value, colors = colors, n = n
)
}
Loading

0 comments on commit 035f015

Please sign in to comment.