diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1fb9c15..3ecc7e1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -33,4 +33,4 @@ jobs: run: lintr::lint_package() shell: Rscript {0} env: - LINTR_ERROR_ON_LINT: false + LINTR_ERROR_ON_LINT: true diff --git a/.lintr b/.lintr new file mode 100644 index 0000000..808ffed --- /dev/null +++ b/.lintr @@ -0,0 +1,3 @@ +linters: linters_with_defaults( + object_name_linter(c("camelCase", "snake_case")) + ) diff --git a/R/app_server.R b/R/app_server.R index a19ea2c..f3950a0 100644 --- a/R/app_server.R +++ b/R/app_server.R @@ -131,7 +131,6 @@ app_server <- function(input, output, session) { # Autoreport ar <- rapbase::readAutoReportData() - # ar <- NULL far <- shiny::reactive({ shiny::req(input$fpackage, input$ftype, input$fowner, input$forganization) diff --git a/R/app_ui.R b/R/app_ui.R index 8818527..e58ae1a 100644 --- a/R/app_ui.R +++ b/R/app_ui.R @@ -5,7 +5,6 @@ app_ui <- function() { - #shiny::addResourcePath("rap", system.file("www", package = "rapbase")) app_title <- "RapAdm" shiny::tagList( @@ -75,7 +74,9 @@ app_ui <- function() { shiny::radioButtons( "downloadFormat", label = shiny::tags$div( - shiny::HTML(as.character(shiny::icon("file-csv")), "File format:") + shiny::HTML( + as.character(shiny::icon("file-csv")), "File format:" + ) ), choices = c("csv", "xlsx-csv") ), diff --git a/R/autoreport.R b/R/autoreport.R index 98c95f9..c3854f7 100644 --- a/R/autoreport.R +++ b/R/autoreport.R @@ -26,8 +26,8 @@ unique_autoreport <- function(data, entity) { #' @param data List containing auto report data #' run. May well contain repeating values #' @param pointRangeMax Integer to provide static range of geom_point as -#' \code{range(1:pointRangeMax)}. If set to 0 (default) the range of current data will be -#' used. +#' \code{range(1:pointRangeMax)}. If set to 0 (default) the range of +#' current data will be used. #' #' @return a (gg)plot object #' @export @@ -44,7 +44,6 @@ calendar_autoreport <- function(data, pointRangeMax = 0) { use.names = FALSE ) } - #stopifnot(is.numeric(unlist(runDayOfYear)) || is.null(runDayOfYear)) stopifnot(is.integer(pointRangeMax) || pointRangeMax == 0) startDate <- Sys.Date() - as.numeric(strftime(Sys.Date(), format = "%d")) + 1 @@ -87,14 +86,16 @@ calendar_autoreport <- function(data, pointRangeMax = 0) { # plot object g <- ggplot2::ggplot( data = b, ggplot2::aes(x = .data$weekOfMonth, y = .data$dayName, - fill = .data$ymnId)) + + fill = .data$ymnId) + ) + ggplot2::geom_tile(colour = "white", size = .1, alpha = 0.3) + ggplot2::facet_wrap(~yearMonthName, scales = "fixed", nrow = 4) + ggplot2::geom_text( data = b, ggplot2::aes(.data$weekOfMonth, .data$dayName, label = .data$monthDayNum), - colour = "black", size = 3.5, nudge_x = .25, nudge_y = -.15) + + colour = "black", size = 3.5, nudge_x = .25, nudge_y = -.15 + ) + ggplot2::theme_minimal() + ggplot2::theme(panel.grid.major = ggplot2::element_blank(), panel.grid.minor = ggplot2::element_blank(), @@ -114,7 +115,8 @@ calendar_autoreport <- function(data, pointRangeMax = 0) { dplyr::left_join(autoReportCount, by = "dayOfYear") g <- g + ggplot2::geom_point(data = b %>% dplyr::filter(!is.na(.data$n)), ggplot2::aes(x = .data$weekOfMonth, - y = .data$dayName, size = .data$n), + y = .data$dayName, + size = .data$n), colour = "#FF7260", alpha = 0.7) }