ices-tools-prod / icesSAG

R interface to Stock Assessment Graphs database web services
http://sg.ices.dk/webservices.aspx
10 stars 7 forks source link

Do not run any examples that access the webservice #182

Closed colinpmillar closed 6 years ago

lintr-bot commented 6 years ago

R/checkKeyArg.R:1:1: style: Variable or function name should be snake_case.

​checkKeyArg <- function(assessmentKey, ...)
^~~~~~~~~~~

R/checkKeyArg.R:1:25: style: Variable or function name should be snake_case.

​checkKeyArg <- function(assessmentKey, ...)
                        ^~~~~~~~~~~~~

R/checkKeyArg.R:2:1: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​{
^

R/checkKeyArg.R:4:3: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​  {
  ^

R/checkKeyArg.R:7:5: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​    {
    ^

R/checkKeyArg.R:8:7: style: Variable or function name should be snake_case.

​      assessmentKey <- dots$key
      ^~~~~~~~~~~~~

R/checkKeyArg.R:9:1: style: Lines should not be more than 80 characters.

​      warning("key argument is depreciated, use assessmentKey instead.", call. = FALSE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/findAssessmentKey.R:5:1: style: Lines should not be more than 80 characters.

​#' @param stock a stock name, e.g. cod-347d, or cod to find all cod stocks, or NULL (default)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/findAssessmentKey.R:8:1: style: Lines should not be more than 80 characters.

​#' @param published whether to include only years where status is "Published" (applies only
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/findAssessmentKey.R:9:1: style: Lines should not be more than 80 characters.

​#'                  when non-secure web services are in use, secure web service always
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/findAssessmentKey.R:33:1: style: Lines should not be more than 80 characters.

​findAssessmentKey <- function(stock = NULL, year = 0, published = TRUE, regex = TRUE, full = FALSE) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/findAssessmentKey.R:33:1: style: Variable or function name should be snake_case.

​findAssessmentKey <- function(stock = NULL, year = 0, published = TRUE, regex = TRUE, full = FALSE) {
^~~~~~~~~~~~~~~~~

R/findAssessmentKey.R:35:38: warning: no visible binding for global variable ‘getListStocks’

​  out <- do.call(rbind, lapply(year, getListStocks))
                                     ^~~~~~~~~~~~~

R/findAssessmentKey.R:41:42: style: Commas should always have a space after.

​    out <- out[out$Status == "Published",]
                                         ^

R/findAssessmentKey.R:50:23: style: Commas should always have a space after.

​    out <- out[select,]
                      ^

R/findAssessmentKey.R:64:1: style: Lines should not be more than 80 characters.

​findKey <- function(stock, year = 0, published = TRUE, regex = TRUE, full = FALSE) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/findAssessmentKey.R:64:1: style: Variable or function name should be snake_case.

​findKey <- function(stock, year = 0, published = TRUE, regex = TRUE, full = FALSE) {
^~~~~~~

R/findAssessmentKey.R:66:3: warning: no visible global function definition for ‘findAssessmentKey’

​  findAssessmentKey(stock = stock, year = year, regex = regex, full = full)
  ^~~~~~~~~~~~~~~~~

R/getFishStockReferencePoints.R:34:1: style: Variable or function name should be snake_case.

​getFishStockReferencePoints <- function(assessmentKey, ...) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/getFishStockReferencePoints.R:34:41: style: Variable or function name should be snake_case.

​getFishStockReferencePoints <- function(assessmentKey, ...) {
                                        ^~~~~~~~~~~~~

R/getFishStockReferencePoints.R:36:3: style: Variable or function name should be snake_case.

​  assessmentKey <- checkKeyArg(assessmentKey = assessmentKey, ...)
  ^~~~~~~~~~~~~

R/getFishStockReferencePoints.R:36:20: warning: no visible global function definition for ‘checkKeyArg’

​  assessmentKey <- checkKeyArg(assessmentKey = assessmentKey, ...)
                   ^~~~~~~~~~~

R/getFishStockReferencePoints.R:39:1: style: Lines should not be more than 80 characters.

​  out <- lapply(assessmentKey, function(i) sag_webservice("getFishStockReferencePoints", assessmentKey = i))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/getFishStockReferencePoints.R:39:44: warning: no visible global function definition for ‘sag_webservice’

​  out <- lapply(assessmentKey, function(i) sag_webservice("getFishStockReferencePoints", assessmentKey = i))
                                           ^~~~~~~~~~~~~~

R/getFishStockReferencePoints.R:42:15: warning: no visible binding for global variable ‘sag_parse’

​  lapply(out, sag_parse)
              ^~~~~~~~~

R/getGraph.R:34:1: style: Variable or function name should be snake_case.

​getLandingsGraph <- function(assessmentKey, ...) {
^~~~~~~~~~~~~~~~

R/getGraph.R:34:30: style: Variable or function name should be snake_case.

​getLandingsGraph <- function(assessmentKey, ...) {
                             ^~~~~~~~~~~~~

R/getGraph.R:36:3: style: Variable or function name should be snake_case.

​  assessmentKey <- checkKeyArg(assessmentKey = assessmentKey, ...)
  ^~~~~~~~~~~~~

R/getGraph.R:36:20: warning: no visible global function definition for ‘checkKeyArg’

​  assessmentKey <- checkKeyArg(assessmentKey = assessmentKey, ...)
                   ^~~~~~~~~~~

R/getGraph.R:39:1: style: Lines should not be more than 80 characters.

​  # NOTE need tail(x, 1) here for when calling as icesSAG::get____(assessmentKey)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/getGraph.R:43:1: style: Lines should not be more than 80 characters.

​  out <- lapply(assessmentKey, function(i) sag_webservice(operation, assessmentKey = i))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/getGraph.R:43:44: warning: no visible global function definition for ‘sag_webservice’

​  out <- lapply(assessmentKey, function(i) sag_webservice(operation, assessmentKey = i))
                                           ^~~~~~~~~~~~~~

R/getGraph.R:46:22: warning: no visible binding for global variable ‘sag_parse’

​  out <- lapply(out, sag_parse, type = "graph")
                     ^~~~~~~~~

R/getGraph.R:57:1: style: Variable or function name should be snake_case.

​getRecruitmentGraph <- getLandingsGraph
^~~~~~~~~~~~~~~~~~~

R/getGraph.R:61:1: style: Variable or function name should be snake_case.

​getFishingMortalityGraph <- getLandingsGraph
^~~~~~~~~~~~~~~~~~~~~~~~

R/getGraph.R:65:1: style: Variable or function name should be snake_case.

​getSpawningStockBiomassGraph <- getLandingsGraph
^~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/getGraph.R:69:1: style: Variable or function name should be snake_case.

​getFishMortality <- getLandingsGraph
^~~~~~~~~~~~~~~~

R/getGraph.R:77:1: style: Variable or function name should be snake_case.

​getYSSB <- getLandingsGraph
^~~~~~~

R/getGraph.R:81:1: style: Variable or function name should be snake_case.

​getSSBHistoricalPerformance <- getLandingsGraph
^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/getGraph.R:85:1: style: Variable and function names should not be longer than 30 characters.

​getFishingMortalityHistoricalPerformance <- getLandingsGraph
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/getGraph.R:85:1: style: Variable or function name should be snake_case.

​getFishingMortalityHistoricalPerformance <- getLandingsGraph
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/getGraph.R:89:1: style: Variable and function names should not be longer than 30 characters.

​getRecruitmentHistoricalPerformance <- getLandingsGraph
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/getGraph.R:89:1: style: Variable or function name should be snake_case.

​getRecruitmentHistoricalPerformance <- getLandingsGraph
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/getGraph.R:93:1: style: Variable or function name should be snake_case.

​getStockStatusTable <- getLandingsGraph
^~~~~~~~~~~~~~~~~~~

R/getLatestStockAdviceList.R:23:1: style: Variable or function name should be snake_case.

​getLatestStockAdviceList <- function() {
^~~~~~~~~~~~~~~~~~~~~~~~

R/getLatestStockAdviceList.R:25:10: warning: no visible global function definition for ‘sag_webservice’

​  out <- sag_webservice("getLatestStockAdviceList")
         ^~~~~~~~~~~~~~

R/getLatestStockAdviceList.R:28:3: warning: no visible global function definition for ‘sag_parse’

​  sag_parse(x = out, type = "table")
  ^~~~~~~~~

R/getListStocks.R:24:1: style: Variable or function name should be snake_case.

​getListStocks <- function(year) {
^~~~~~~~~~~~~

R/getListStocks.R:26:35: warning: no visible global function definition for ‘sag_webservice’

​  out <- lapply(year, function(i) sag_webservice("getListStocks", year = i))
                                  ^~~~~~~~~~~~~~

R/getListStocks.R:29:30: warning: no visible binding for global variable ‘sag_parse’

​  do.call(rbind, lapply(out, sag_parse))
                             ^~~~~~~~~

R/getSAG.R:43:1: style: Lines should not be more than 80 characters.

​getSAG <- function(stock, year, data = "summary", combine = TRUE, purpose = "Advice") {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/getSAG.R:43:1: style: Variable or function name should be snake_case.

​getSAG <- function(stock, year, data = "summary", combine = TRUE, purpose = "Advice") {
^~~~~~

R/getSAG.R:52:3: style: Variable or function name should be snake_case.

​  assessmentKey <- findAssessmentKey(stock, year, regex = TRUE, full = FALSE)
  ^~~~~~~~~~~~~

R/getSAG.R:52:20: warning: no visible global function definition for ‘findAssessmentKey’

​  assessmentKey <- findAssessmentKey(stock, year, regex = TRUE, full = FALSE)
                   ^~~~~~~~~~~~~~~~~

R/getSAG.R:63:5: style: Variable or function name should be snake_case.

​    outNames <- unique(unlist(lapply(out, names)))
    ^~~~~~~~

R/getSAG.R:70:11: style: Variable or function name should be snake_case.

​          missing.cols <- !outNames %in% names(x)
          ^~~~~~~~~~~~

R/getSAG.R:80:12: warning: no visible global function definition for ‘simplify’

​    out <- simplify(out)
           ^~~~~~~~

R/getSAGGraphs.R:30:1: style: Variable or function name should be snake_case.

​getSAGGraphs <- function(assessmentKey, ...) {
^~~~~~~~~~~~

R/getSAGGraphs.R:30:26: style: Variable or function name should be snake_case.

​getSAGGraphs <- function(assessmentKey, ...) {
                         ^~~~~~~~~~~~~

R/getSAGGraphs.R:31:3: style: Variable or function name should be snake_case.

​  assessmentKey <- checkKeyArg(assessmentKey = assessmentKey, ...)
  ^~~~~~~~~~~~~

R/getSAGGraphs.R:31:20: warning: no visible global function definition for ‘checkKeyArg’

​  assessmentKey <- checkKeyArg(assessmentKey = assessmentKey, ...)
                   ^~~~~~~~~~~

R/getSAGGraphs.R:35:5: style: Variable or function name should be snake_case.

​    assessmentKey <- assessmentKey[1]
    ^~~~~~~~~~~~~

R/getSAGTypeGraphsSettings.R:3:1: style: Lines should not be more than 80 characters.

​#' List all possible chart settings for each chart type (0 = general, 1 = Landings etc.).
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/getSAGTypeGraphsSettings.R:21:1: style: Variable or function name should be snake_case.

​getSAGTypeGraphs <- function() {
^~~~~~~~~~~~~~~~

R/getSAGTypeGraphsSettings.R:23:10: warning: no visible global function definition for ‘sag_webservice’

​  out <- sag_webservice("getSAGTypeGraphs")
         ^~~~~~~~~~~~~~

R/getSAGTypeGraphsSettings.R:26:3: warning: no visible global function definition for ‘sag_parse’

​  sag_parse(out)
  ^~~~~~~~~

R/getSAGTypeGraphsSettings.R:31:1: style: Variable or function name should be snake_case.

​getSAGTypeSettings <- function(SAGChartKey) {
^~~~~~~~~~~~~~~~~~

R/getSAGTypeGraphsSettings.R:31:32: style: Variable or function name should be snake_case.

​getSAGTypeSettings <- function(SAGChartKey) {
                               ^~~~~~~~~~~

R/getSAGTypeGraphsSettings.R:33:10: warning: no visible global function definition for ‘sag_webservice’

​  out <- sag_webservice("getSAGTypeSettings", SAGChartKey = SAGChartKey)
         ^~~~~~~~~~~~~~

R/getSAGTypeGraphsSettings.R:36:3: warning: no visible global function definition for ‘sag_parse’

​  sag_parse(out)
  ^~~~~~~~~

R/getsetSettingsForAStock.R:7:1: style: Lines should not be more than 80 characters.

​#' @param settingKey the type identifier of the SAG chart setting, e.g. 0, 1, 2, ...
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/getsetSettingsForAStock.R:9:1: style: Lines should not be more than 80 characters.

​#' @param copyNextYear should the settings be copied to next year (TRUE) or not (FALSE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/getsetSettingsForAStock.R:11:1: style: Lines should not be more than 80 characters.

​#' @return A data frame with SAG chart type IDs, settings IDs and setting values.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/getsetSettingsForAStock.R:38:1: style: Variable or function name should be snake_case.

​getSAGSettingsForAStock <- function(assessmentKey) {
^~~~~~~~~~~~~~~~~~~~~~~

R/getsetSettingsForAStock.R:38:37: style: Variable or function name should be snake_case.

​getSAGSettingsForAStock <- function(assessmentKey) {
                                    ^~~~~~~~~~~~~

R/getsetSettingsForAStock.R:40:1: style: Lines should not be more than 80 characters.

​  out <- sag_webservice("getSAGSettingsForAStock", assessmentKey = assessmentKey)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/getsetSettingsForAStock.R:40:10: warning: no visible global function definition for ‘sag_webservice’

​  out <- sag_webservice("getSAGSettingsForAStock", assessmentKey = assessmentKey)
         ^~~~~~~~~~~~~~

R/getsetSettingsForAStock.R:43:3: warning: no visible global function definition for ‘sag_parse’

​  sag_parse(out)
  ^~~~~~~~~

R/getsetSettingsForAStock.R:48:1: style: Lines should not be more than 80 characters.

​setSAGSettingForAStock <- function(assessmentKey, chartKey, settingKey, settingValue, copyNextYear) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/getsetSettingsForAStock.R:48:1: style: Variable or function name should be snake_case.

​setSAGSettingForAStock <- function(assessmentKey, chartKey, settingKey, settingValue, copyNextYear) {
^~~~~~~~~~~~~~~~~~~~~~

R/getsetSettingsForAStock.R:48:36: style: Variable or function name should be snake_case.

​setSAGSettingForAStock <- function(assessmentKey, chartKey, settingKey, settingValue, copyNextYear) {
                                   ^~~~~~~~~~~~~

R/getsetSettingsForAStock.R:48:51: style: Variable or function name should be snake_case.

​setSAGSettingForAStock <- function(assessmentKey, chartKey, settingKey, settingValue, copyNextYear) {
                                                  ^~~~~~~~

R/getsetSettingsForAStock.R:48:61: style: Variable or function name should be snake_case.

​setSAGSettingForAStock <- function(assessmentKey, chartKey, settingKey, settingValue, copyNextYear) {
                                                            ^~~~~~~~~~

R/getsetSettingsForAStock.R:48:73: style: Variable or function name should be snake_case.

​setSAGSettingForAStock <- function(assessmentKey, chartKey, settingKey, settingValue, copyNextYear) {
                                                                        ^~~~~~~~~~~~

R/getsetSettingsForAStock.R:48:87: style: Variable or function name should be snake_case.

​setSAGSettingForAStock <- function(assessmentKey, chartKey, settingKey, settingValue, copyNextYear) {
                                                                                      ^~~~~~~~~~~~

R/getsetSettingsForAStock.R:53:1: style: Lines should not be more than 80 characters.

​                        settingValue = settingValue, copyNextYear = copyNextYear)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/getsetSettingsForAStock.R:56:13: warning: no visible global function definition for ‘simplify’

​  invisible(simplify(unlist(out)))
            ^~~~~~~~

R/getStockDownloadData.R:33:1: style: Variable or function name should be snake_case.

​getStockDownloadData <- function(assessmentKey, ...) {
^~~~~~~~~~~~~~~~~~~~

R/getStockDownloadData.R:33:34: style: Variable or function name should be snake_case.

​getStockDownloadData <- function(assessmentKey, ...) {
                                 ^~~~~~~~~~~~~

R/getStockDownloadData.R:34:3: style: Variable or function name should be snake_case.

​  assessmentKey <- checkKeyArg(assessmentKey = assessmentKey, ...)
  ^~~~~~~~~~~~~

R/getStockDownloadData.R:34:20: warning: no visible global function definition for ‘checkKeyArg’

​  assessmentKey <- checkKeyArg(assessmentKey = assessmentKey, ...)
                   ^~~~~~~~~~~

R/getStockDownloadData.R:37:1: style: Lines should not be more than 80 characters.

​  out <- lapply(assessmentKey, function(i) sag_webservice("getStockDownloadData", assessmentKey = i))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/getStockDownloadData.R:37:44: warning: no visible global function definition for ‘sag_webservice’

​  out <- lapply(assessmentKey, function(i) sag_webservice("getStockDownloadData", assessmentKey = i))
                                           ^~~~~~~~~~~~~~

R/getStockDownloadData.R:40:15: warning: no visible binding for global variable ‘sag_parse’

​  lapply(out, sag_parse, type = "table")
              ^~~~~~~~~

R/getStockDownloadData.R:45:1: style: Variable or function name should be snake_case.

​getStockSourceData <- function(assessmentKey, ...) {
^~~~~~~~~~~~~~~~~~

R/getStockDownloadData.R:45:32: style: Variable or function name should be snake_case.

​getStockSourceData <- function(assessmentKey, ...) {
                               ^~~~~~~~~~~~~

R/getStockDownloadData.R:46:3: style: Variable or function name should be snake_case.

​  assessmentKey <- checkKeyArg(assessmentKey = assessmentKey, ...)
  ^~~~~~~~~~~~~

R/getStockDownloadData.R:46:20: warning: no visible global function definition for ‘checkKeyArg’

​  assessmentKey <- checkKeyArg(assessmentKey = assessmentKey, ...)
                   ^~~~~~~~~~~

R/getStockDownloadData.R:54:1: style: Lines should not be more than 80 characters.

​  out <- sapply(assessmentKey, function(i) sag_documentService_uri("XMLDownload", assessmentKey = i))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/getStockDownloadData.R:54:44: warning: no visible global function definition for ‘sag_documentService_uri’

​  out <- sapply(assessmentKey, function(i) sag_documentService_uri("XMLDownload", assessmentKey = i))
                                           ^~~~~~~~~~~~~~~~~~~~~~~

R/getStockDownloadData.R:61:1: style: Lines should not be more than 80 characters.

​    if (length(peek) == 4 || peek[1] %in% c("Sorry stock not found", "Not autorized, please specify the token")) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/getStockDownloadData.R:64:7: warning: no visible global function definition for ‘readSAGxml’

​      readSAGxml(x)
      ^~~~~~~~~~

R/getStockDownloadData.R:71:1: style: Lines should not be more than 80 characters.

​    names(out)[notnull] <- sapply(out[notnull], function(x) paste0(x$info$StockCode, "_", x$info$AssessmentYear))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/getStockStatusValues.R:31:1: style: Variable or function name should be snake_case.

​getStockStatusValues <- function(assessmentKey, ...) {
^~~~~~~~~~~~~~~~~~~~

R/getStockStatusValues.R:31:34: style: Variable or function name should be snake_case.

​getStockStatusValues <- function(assessmentKey, ...) {
                                 ^~~~~~~~~~~~~

R/getStockStatusValues.R:33:3: style: Variable or function name should be snake_case.

​  assessmentKey <- checkKeyArg(assessmentKey = assessmentKey, ...)
  ^~~~~~~~~~~~~

R/getStockStatusValues.R:33:20: warning: no visible global function definition for ‘checkKeyArg’

​  assessmentKey <- checkKeyArg(assessmentKey = assessmentKey, ...)
                   ^~~~~~~~~~~

R/getStockStatusValues.R:36:1: style: Lines should not be more than 80 characters.

​  out <- lapply(assessmentKey, function(i) sag_webservice("getStockStatusValues", assessmentKey = i))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/getStockStatusValues.R:36:44: warning: no visible global function definition for ‘sag_webservice’

​  out <- lapply(assessmentKey, function(i) sag_webservice("getStockStatusValues", assessmentKey = i))
                                           ^~~~~~~~~~~~~~

R/getStockStatusValues.R:39:15: warning: no visible binding for global variable ‘sag_parse’

​  lapply(out, sag_parse, type = "table")
              ^~~~~~~~~

R/getSummaryTable.R:31:1: style: Variable or function name should be snake_case.

​getSummaryTable <- function(assessmentKey, ...) {
^~~~~~~~~~~~~~~

R/getSummaryTable.R:31:29: style: Variable or function name should be snake_case.

​getSummaryTable <- function(assessmentKey, ...) {
                            ^~~~~~~~~~~~~

R/getSummaryTable.R:33:3: style: Variable or function name should be snake_case.

​  assessmentKey <- checkKeyArg(assessmentKey = assessmentKey, ...)
  ^~~~~~~~~~~~~

R/getSummaryTable.R:33:20: warning: no visible global function definition for ‘checkKeyArg’

​  assessmentKey <- checkKeyArg(assessmentKey = assessmentKey, ...)
                   ^~~~~~~~~~~

R/getSummaryTable.R:36:1: style: Lines should not be more than 80 characters.

​  out <- lapply(assessmentKey, function(i) sag_webservice("getSummaryTable", assessmentKey = i))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/getSummaryTable.R:36:44: warning: no visible global function definition for ‘sag_webservice’

​  out <- lapply(assessmentKey, function(i) sag_webservice("getSummaryTable", assessmentKey = i))
                                           ^~~~~~~~~~~~~~

R/getSummaryTable.R:39:15: warning: no visible binding for global variable ‘sag_parse’

​  lapply(out, sag_parse, type = "summary")
              ^~~~~~~~~

R/getYSBRSummaryTable.R:30:1: style: Variable or function name should be snake_case.

​getYSBRSummaryTable <- function(assessmentKey, ...) {
^~~~~~~~~~~~~~~~~~~

R/getYSBRSummaryTable.R:30:33: style: Variable or function name should be snake_case.

​getYSBRSummaryTable <- function(assessmentKey, ...) {
                                ^~~~~~~~~~~~~

R/getYSBRSummaryTable.R:32:3: style: Variable or function name should be snake_case.

​  assessmentKey <- checkKeyArg(assessmentKey = assessmentKey, ...)
  ^~~~~~~~~~~~~

R/getYSBRSummaryTable.R:32:20: warning: no visible global function definition for ‘checkKeyArg’

​  assessmentKey <- checkKeyArg(assessmentKey = assessmentKey, ...)
                   ^~~~~~~~~~~

R/getYSBRSummaryTable.R:35:1: style: Lines should not be more than 80 characters.

​  out <- lapply(assessmentKey, function(i) sag_webservice("getYSBRSummaryTable", assessmentKey = i))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/getYSBRSummaryTable.R:35:44: warning: no visible global function definition for ‘sag_webservice’

​  out <- lapply(assessmentKey, function(i) sag_webservice("getYSBRSummaryTable", assessmentKey = i))
                                           ^~~~~~~~~~~~~~

R/getYSBRSummaryTable.R:38:15: warning: no visible binding for global variable ‘sag_parse’

​  lapply(out, sag_parse, type = "summary")
              ^~~~~~~~~

R/SAGtokens.R:5:11: style: Variable or function name should be snake_case.

​.sg_envir$.sg_tokenOK <- NA
          ^~~~~~~~~~~

R/SAGtokens.R:30:1: style: Variable or function name should be snake_case.

​getTokenExpiration <- function() {
^~~~~~~~~~~~~~~~~~

R/SAGtokens.R:32:19: warning: no visible binding for global variable ‘.sg_renviron’

​  if (file.exists(.sg_renviron)) readRenviron(.sg_renviron)
                  ^~~~~~~~~~~~

R/SAGtokens.R:32:19: warning: no visible binding for global variable ‘.sg_renviron’

​  if (file.exists(.sg_renviron)) readRenviron(.sg_renviron)
                  ^~~~~~~~~~~~

R/SAGtokens.R:33:10: warning: no visible global function definition for ‘sag_uri’

​  uri <- sag_uri("getTokenExpiration", token = Sys.getenv('SG_PAT'))
         ^~~~~~~

R/SAGtokens.R:33:59: style: Only use double-quotes.

​  uri <- sag_uri("getTokenExpiration", token = Sys.getenv('SG_PAT'))
                                                          ^~~~~~~~

R/SAGtokens.R:34:10: warning: no visible global function definition for ‘sag_get’

​  out <- sag_get(uri)
         ^~~~~~~

R/SAGtokens.R:44:27: warning: no visible global function definition for ‘getTokenExpiration’

​    assign(".sg_tokenOK", getTokenExpiration() > 0, envir = .sg_envir)
                          ^~~~~~~~~~~~~~~~~~

R/SAGtokens.R:44:61: warning: no visible binding for global variable ‘.sg_envir’

​    assign(".sg_tokenOK", getTokenExpiration() > 0, envir = .sg_envir)
                                                            ^~~~~~~~~

R/SAGtokens.R:46:8: style: Place a space before left parenthesis, except in a function call.

​  while(!.sg_envir$.sg_tokenOK) {
       ^

R/SAGtokens.R:56:5: warning: local variable ‘tmp’ assigned but may not be used

​    tmp <- readline("Press return when this is done ...")
    ^~~

R/SAGtokens.R:57:27: warning: no visible global function definition for ‘getTokenExpiration’

​    assign(".sg_tokenOK", getTokenExpiration() > 0, envir = .sg_envir)
                          ^~~~~~~~~~~~~~~~~~

R/SAGtokens.R:57:61: warning: no visible binding for global variable ‘.sg_envir’

​    assign(".sg_tokenOK", getTokenExpiration() > 0, envir = .sg_envir)
                                                            ^~~~~~~~~

R/SAGtokens.R:60:14: style: Only use double-quotes.

​  Sys.getenv('SG_PAT')
             ^~~~~~~~

R/SAGtokens.R:62:1: style: Trailing blank lines are superfluous.

​
^

R/SAGxml.R:3:1: style: Lines should not be more than 80 characters.

​#' Convert between R data (a list and a data.frame) and the XML format required for uploading
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/SAGxml.R:10:1: style: Lines should not be more than 80 characters.

​#' @return Either a list containing info and fishdata, or a string containing the xml file.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/SAGxml.R:33:1: style: Variable or function name should be snake_case.

​createSAGxml <- function(info, fishdata) {
^~~~~~~~~~~~

R/SAGxml.R:36:33: style: Variable or function name should be snake_case.

​  if (is.na(info$Purpose)) info$Purpose <- "Advice"
                                ^~~~~~~

R/SAGxml.R:53:1: style: Lines should not be more than 80 characters.

​                  "<?xml-stylesheet type='text/xsl' href='StandrdGraphsStyle.xsl'?>",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/SAGxml.R:54:1: style: Lines should not be more than 80 characters.

​                  "<Assessment xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='ICES_Standard_Graphs.xsd'>",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/SAGxml.R:58:33: warning: no visible global function definition for ‘validNames’

​  info <- info[names(info) %in% validNames("stockInfo")]
                                ^~~~~~~~~~

R/SAGxml.R:62:45: warning: no visible global function definition for ‘validNames’

​  fishdata <- fishdata[names(fishdata) %in% validNames("stockFishdata")]
                                            ^~~~~~~~~~

R/SAGxml.R:68:1: style: Lines should not be more than 80 characters.

​         list2xml(apply(fishdata, 1, list2xml), xnames = "Fish_Data", sep = "\r\n"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/SAGxml.R:75:1: style: Variable or function name should be snake_case.

​readSAGxml <- function(file) {
^~~~~~~~~~

R/SAGxml.R:79:3: warning: no visible global function definition for ‘sag_parse’

​  sag_parse(out, type = "upload")
  ^~~~~~~~~

R/SAGxml.R:83:1: style: Variable or function name should be snake_case.

​sag_parseUpload <- function(x) {
^~~~~~~~~~~~~~~

R/SAGxml.R:85:11: warning: no visible global function definition for ‘sag_parseTable’

​  info <- sag_parseTable(list(x[names(x) != "Fish_Data"]))
          ^~~~~~~~~~~~~~

R/SAGxml.R:86:19: warning: no visible binding for global variable ‘stockInfo’

​  info <- do.call(stockInfo, info)
                  ^~~~~~~~~

R/SAGxml.R:89:15: warning: no visible global function definition for ‘sag_parseTable’

​  fishdata <- sag_parseTable(unname(x[names(x) == "Fish_Data"]))
              ^~~~~~~~~~~~~~

R/SAGxml.R:90:23: warning: no visible binding for global variable ‘stockFishdata’

​  fishdata <- do.call(stockFishdata, fishdata)
                      ^~~~~~~~~~~~~

R/SAGxml.R:99:1: style: Lines should not be more than 80 characters.

​#' This function is a wrapper to \code{list(...)} in which the names are forced to match with
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/SAGxml.R:100:1: style: Lines should not be more than 80 characters.

​#' the names required for the SAG database.  See http://dome.ices.dk/datsu/selRep.aspx?Dataset=126
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/SAGxml.R:105:1: style: Lines should not be more than 80 characters.

​#' @param ContactPerson the email for the person responsible for uploading the stock data.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/SAGxml.R:109:1: style: Lines should not be more than 80 characters.

​#' @param ModelType the type of the model used (see below for links to more information)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/SAGxml.R:114:1: style: Lines should not be more than 80 characters.

​#' @return A named sag.list, inheriting from a list, where all names are valid column names in the
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/SAGxml.R:127:1: style: Lines should not be more than 80 characters.

​#' Link to the relevant format description is \url{http://datsu.ices.dk/web/selRep.aspx?Dataset=126}
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/SAGxml.R:160:1: style: Variable or function name should be snake_case.

​stockInfo <- function(StockCode, AssessmentYear, ContactPerson, StockCategory,
^~~~~~~~~

R/SAGxml.R:160:23: style: Variable or function name should be snake_case.

​stockInfo <- function(StockCode, AssessmentYear, ContactPerson, StockCategory,
                      ^~~~~~~~~

R/SAGxml.R:160:34: style: Variable or function name should be snake_case.

​stockInfo <- function(StockCode, AssessmentYear, ContactPerson, StockCategory,
                                 ^~~~~~~~~~~~~~

R/SAGxml.R:160:50: style: Variable or function name should be snake_case.

​stockInfo <- function(StockCode, AssessmentYear, ContactPerson, StockCategory,
                                                 ^~~~~~~~~~~~~

R/SAGxml.R:160:65: style: Variable or function name should be snake_case.

​stockInfo <- function(StockCode, AssessmentYear, ContactPerson, StockCategory,
                                                                ^~~~~~~~~~~~~

R/SAGxml.R:161:23: style: Variable or function name should be snake_case.

​                      Purpose = "Advice", ModelType, ModelName, ...) {
                      ^~~~~~~

R/SAGxml.R:161:43: style: Variable or function name should be snake_case.

​                      Purpose = "Advice", ModelType, ModelName, ...) {
                                          ^~~~~~~~~

R/SAGxml.R:161:54: style: Variable or function name should be snake_case.

​                      Purpose = "Advice", ModelType, ModelName, ...) {
                                                     ^~~~~~~~~

R/SAGxml.R:171:1: style: Lines should not be more than 80 characters.

​         utils::capture.output(noquote(names(val))[!names(val) %in% validNames("stockInfo")]),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/SAGxml.R:174:1: style: Lines should not be more than 80 characters.

​  val$NameSystemProducedFile <- paste("icesSAG R package version", utils::packageVersion("icesSAG"))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/SAGxml.R:174:7: style: Variable or function name should be snake_case.

​  val$NameSystemProducedFile <- paste("icesSAG R package version", utils::packageVersion("icesSAG"))
      ^~~~~~~~~~~~~~~~~~~~~~

R/SAGxml.R:175:30: warning: no visible global function definition for ‘validNames’

​  val <- val[names(val) %in% validNames("stockInfo")]
                             ^~~~~~~~~~

R/SAGxml.R:177:25: warning: no visible global function definition for ‘validNames’

​  extra_cols <- setdiff(validNames("stockInfo"), names(val))
                        ^~~~~~~~~~

R/SAGxml.R:182:14: warning: no visible global function definition for ‘validNames’

​  val <- val[validNames("stockInfo")]
             ^~~~~~~~~~

R/SAGxml.R:192:1: style: Lines should not be more than 80 characters.

​    warning("The following entries(s) are invalid and will be ignored on upload:\n",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/SAGxml.R:193:1: style: Lines should not be more than 80 characters.

​         utils::capture.output(noquote(names(x))[!names(x) %in% validNames("stockInfo")]),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/SAGxml.R:197:24: warning: no visible global function definition for ‘validNames’

​  x <- x[names(x) %in% validNames("stockInfo")]
                       ^~~~~~~~~~

R/SAGxml.R:207:1: style: Lines should not be more than 80 characters.

​#' This function is a wrapper to \code{data.frame(...)} in which the names are forced to match with
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/SAGxml.R:208:1: style: Lines should not be more than 80 characters.

​#' the names required for the SAG database.  See http://dome.ices.dk/datsu/selRep.aspx?Dataset=126
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/SAGxml.R:215:1: style: Lines should not be more than 80 characters.

​#' @return A data.frame, where all names are valid column names in the SAG database.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/SAGxml.R:223:1: style: Variable or function name should be snake_case.

​stockFishdata <- function(Year, ...) {
^~~~~~~~~~~~~

R/SAGxml.R:223:27: style: Variable or function name should be snake_case.

​stockFishdata <- function(Year, ...) {
                          ^~~~

R/SAGxml.R:229:1: style: Lines should not be more than 80 characters.

​         utils::capture.output(noquote(names(val))[!names(val) %in% validNames("stockFishdata")]),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/SAGxml.R:232:30: warning: no visible global function definition for ‘validNames’

​  val <- val[names(val) %in% validNames("stockFishdata")]
                             ^~~~~~~~~~

R/SAGxml.R:233:7: style: Variable or function name should be snake_case.

​  val$stringsAsFactors <- FALSE
      ^~~~~~~~~~~~~~~~

R/SAGxml.R:235:15: warning: no visible global function definition for ‘validNames’

​  val[setdiff(validNames("stockFishdata"), names(val))] <- NA
              ^~~~~~~~~~

R/SAGxml.R:245:1: style: Lines should not be more than 80 characters.

​    warning("The following column(s) are invalid and will be ignored on upload:\n",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/SAGxml.R:246:1: style: Lines should not be more than 80 characters.

​         utils::capture.output(noquote(names(x))[!names(x) %in% validNames("stockFishdata")]),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/SAGxml.R:250:24: warning: no visible global function definition for ‘validNames’

​  x <- x[names(x) %in% validNames("stockFishdata")]
                       ^~~~~~~~~~

R/SAGxml.R:253:1: style: Lines should not be more than 80 characters.

​  print.data.frame(x, ..., digits = digits, quote = quote, right = right, row.names = row.names)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/SAGxml.R:257:1: style: Variable or function name should be snake_case.

​validNames <- function(type = c("stockInfo", "stockFishdata")) {
^~~~~~~~~~

R/SAGxml.R:337:1: style: Variable or function name should be snake_case.

​checkStockInfo <- function(info) {
^~~~~~~~~~~~~~

R/SAGxml.R:349:1: style: Lines should not be more than 80 characters.

​    ending <- sapply(1:length(loc1), function(i) paste(ending[loc1[i]:loc2[i]], collapse = ""))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/SAGxml.R:351:1: style: Lines should not be more than 80 characters.

​    errors$StockCode <- paste0("non valid stock code (",  info$StockCode,"). Did you mean on of these: ", paste(part1, maybe[maybeid], sep = ".", collapse = ", "), "?")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/SAGxml.R:351:12: style: Variable or function name should be snake_case.

​    errors$StockCode <- paste0("non valid stock code (",  info$StockCode,"). Did you mean on of these: ", paste(part1, maybe[maybeid], sep = ".", collapse = ", "), "?")
           ^~~~~~~~~

R/SAGxml.R:351:74: style: Commas should always have a space after.

​    errors$StockCode <- paste0("non valid stock code (",  info$StockCode,"). Did you mean on of these: ", paste(part1, maybe[maybeid], sep = ".", collapse = ", "), "?")
                                                                         ^

R/SAGxml.R:364:1: style: Variable or function name should be snake_case.

​checkStockFishdata <- function(fishdata) {
^~~~~~~~~~~~~~~~~~

R/uploadStock.R:10:1: style: Lines should not be more than 80 characters.

​#' @return The database key of the new / updated stock, or 0 if there was an error.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/uploadStock.R:22:1: style: Variable or function name should be snake_case.

​uploadStock <- function(info, fishdata, verbose = FALSE) {
^~~~~~~~~~~
lintr-bot commented 6 years ago

R/findAssessmentKey.R:41:42: style: Commas should always have a space after.

​    out <- out[out$Status == "Published",]
                                         ^

R/findAssessmentKey.R:50:23: style: Commas should always have a space after.

​    out <- out[select,]
                      ^

R/getGraph.R:85:1: style: Variable and function names should not be longer than 30 characters.

​getFishingMortalityHistoricalPerformance <- getLandingsGraph
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/getGraph.R:89:1: style: Variable and function names should not be longer than 30 characters.

​getRecruitmentHistoricalPerformance <- getLandingsGraph
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/SAGtokens.R:33:59: style: Only use double-quotes.

​  uri <- sag_uri("getTokenExpiration", token = Sys.getenv('SG_PAT'))
                                                          ^~~~~~~~

R/SAGtokens.R:46:8: style: Place a space before left parenthesis, except in a function call.

​  while(!.sg_envir$.sg_tokenOK) {
       ^

R/SAGtokens.R:60:14: style: Only use double-quotes.

​  Sys.getenv('SG_PAT')
             ^~~~~~~~

R/SAGtokens.R:62:1: style: Trailing blank lines are superfluous.

​
^

R/SAGxml.R:54:1: style: Lines should not be more than 120 characters.

​                  "<Assessment xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='ICES_Standard_Graphs.xsd'>",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/SAGxml.R:351:1: style: Lines should not be more than 120 characters.

​    errors$StockCode <- paste0("non valid stock code (",  info$StockCode,"). Did you mean on of these: ", paste(part1, maybe[maybeid], sep = ".", collapse = ", "), "?")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/SAGxml.R:351:74: style: Commas should always have a space after.

​    errors$StockCode <- paste0("non valid stock code (",  info$StockCode,"). Did you mean on of these: ", paste(part1, maybe[maybeid], sep = ".", collapse = ", "), "?")
                                                                         ^

R/uploadStock.R:87:1: style: Lines should not be more than 120 characters.

​  message(sprintf("To check upload run (with 'options(icesSAG.use_token = TRUE)'): \n  findAssessmentKey('%s', %s, full = TRUE)", info$StockCode, info$AssessmentYear))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/uploadStock.R:88:4: style: Commented code should be removed.

​  #res <- capture.output(findAssessmentKey(info$StockCode, info$AssessmentYear, full = TRUE))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/uploadStock.R:89:4: style: Commented code should be removed.

​  #message("\n", paste(res, collapse = "\n"))
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/uploadXMLFile.R:7:8: style: Commented code should be removed.

​    #  message("POSTing ... ", uri)
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/uploadXMLFile.R:20:1: style: Trailing blank lines are superfluous.

​
^

R/utilities.R:176:29: style: Commas should always have a space after.

​  keep <- which(keep)[seq(1,sum(keep), by = 2)]
                            ^

R/utilities.R:208:21: style: Put spaces around all infix operators.

​  x_loc <- rep((1:r)/r - 1/(2*r), c)
                   ~^~

R/utilities.R:208:27: style: Put spaces around all infix operators.

​  x_loc <- rep((1:r)/r - 1/(2*r), c)
                         ~^~

R/utilities.R:208:28: style: Place a space before left parenthesis, except in a function call.

​  x_loc <- rep((1:r)/r - 1/(2*r), c)
                           ^

R/utilities.R:208:30: style: Put spaces around all infix operators.

​  x_loc <- rep((1:r)/r - 1/(2*r), c)
                            ~^~

R/utilities.R:209:21: style: Put spaces around all infix operators.

​  y_loc <- rep((c:1)/c  - 1/(2*c), each = r)
                   ~^~

R/utilities.R:209:28: style: Put spaces around all infix operators.

​  y_loc <- rep((c:1)/c  - 1/(2*c), each = r)
                          ~^~

R/utilities.R:209:29: style: Place a space before left parenthesis, except in a function call.

​  y_loc <- rep((c:1)/c  - 1/(2*c), each = r)
                            ^

R/utilities.R:209:31: style: Put spaces around all infix operators.

​  y_loc <- rep((c:1)/c  - 1/(2*c), each = r)
                             ~^~

R/utilities.R:212:70: style: Put spaces around all infix operators.

​      grid::grid.raster(x[[i]], x = x_loc[i], y = y_loc[i], width = 1/r, height = 1/c)
                                                                    ~^~

R/utilities.R:212:84: style: Put spaces around all infix operators.

​      grid::grid.raster(x[[i]], x = x_loc[i], y = y_loc[i], width = 1/r, height = 1/c)
                                                                                  ~^~

R/utilities.R:260:1: style: Trailing blank lines are superfluous.

​
^

R/WSDL_parser.R:40:1: style: Trailing blank lines are superfluous.

​
^
lintr-bot commented 6 years ago

R/getGraph.R:85:1: style: Variable and function names should not be longer than 30 characters.

​getFishingMortalityHistoricalPerformance <- getLandingsGraph
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/getGraph.R:89:1: style: Variable and function names should not be longer than 30 characters.

​getRecruitmentHistoricalPerformance <- getLandingsGraph
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/SAGxml.R:54:1: style: Lines should not be more than 120 characters.

​                  "<Assessment xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='ICES_Standard_Graphs.xsd'>",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~