hugheylab/pmparser

lintr found issues with code

Closed this issue · 0 comments

  1. R/get_citation.R line 5: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/get_citation.R#L5)
    published_date = name = NULL 
  2. R/get_citation.R line 106: Lines should not be more than 120 characters. (https://github.com/hugheylab/pmparser/blob/master/R/get_citation.R#L106)
    glue(' \r\n powershell -command "Get-Content -Path {pathTmpCsv} -TotalCount {nrows + 1L} | Set-Content {pathTmpCsv2}" ', 
  3. R/get_parsing_tables.R line 2: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/get_parsing_tables.R#L2)
    xml_filename = NULL 
  4. R/get_parsing_tables.R line 94: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/get_parsing_tables.R#L94)
    r[[tableName]][, xml_filename := ac] 
  5. R/get_pubmed_files.R line 15: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/get_pubmed_files.R#L15)
    sub_dir = subDir = . = xml_filename = NULL 
  6. R/get_pubmed_files.R line 20: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/get_pubmed_files.R#L20)
    dNow[, sub_dir := subDir]} 
  7. R/get_pubmed_files.R line 58: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/get_pubmed_files.R#L58)
    md5_match = md5_computed = md5_provided = NULL 
  8. R/get_pubmed_files.R line 61: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/get_pubmed_files.R#L61)
    d[, md5_match := md5_computed == md5_provided] 
  9. R/get_pubmed_files.R line 69: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/get_pubmed_files.R#L69)
    md5_download = xml_download = f = sub_dir = xml_filename = md5_filename = 
  10. R/get_pubmed_files.R line 70: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/get_pubmed_files.R#L70)
    md5_match = NULL 
  11. R/get_pubmed_files.R line 80: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/get_pubmed_files.R#L80)
    fileInfo[, md5_download := NA_integer_] 
  12. R/get_pubmed_files.R line 82: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/get_pubmed_files.R#L82)
    fileInfo[, md5_download := xml_download]} 
  13. R/get_pubmed_files.R line 91: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/get_pubmed_files.R#L91)
    fileInfo[is.na(md5_download), md5_download := r] 
  14. R/get_pubmed_files.R line 107: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/get_pubmed_files.R#L107)
    fileInfo[!(md5_match), xml_download := r] 
  15. R/get_test_standard.R line 19: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/get_test_standard.R#L19)
    .N = pmid = N = . = step = NULL 
  16. R/get_test_standard.R line 51: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/get_test_standard.R#L51)
    sub_dir = .N = sample_base = NULL 
  17. R/get_test_standard.R line 62: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/get_test_standard.R#L62)
    dFile[, sample_base := gsub('\\.xml.*$', '', sampleBase)][]} 
  18. R/get_test_standard.R line 92: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/get_test_standard.R#L92)
    parsed$pmid_status = parsed$pmid_status[[2L]] 
  19. R/get_test_standard.R line 99: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/get_test_standard.R#L99)
    sub_dir = NULL 
  20. R/get_test_standard.R line 106: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/get_test_standard.R#L106)
    sub_dir = xml_download = xml_filename = md5_filename = NULL 
  21. R/modify_pubmed_db.R line 41: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/modify_pubmed_db.R#L41)
    processed = .N = md5_match = xml_filename = . = step = NULL 
  22. R/parse_element.R line 149: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L149)
    .N = id_type = NULL 
  23. R/parse_element.R line 168: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L168)
    pub_date = y = m = d = NULL 
  24. R/parse_element.R line 187: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L187)
    x4[, pub_date := as.Date(sprintf('%s-%s-%s', y, m, d))] 
  25. R/parse_element.R line 201: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L201)
    .N = pub_date = y = m = d = NULL 
  26. R/parse_element.R line 214: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L214)
    x4[, pub_date := as.Date(sprintf('%s-%s-%s', y, m, d))] 
  27. R/parse_element.R line 224: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L224)
    medline_date = pub_month_tmp1 = pub_month = pub_day_tmp = pub_day = pub_year = 
  28. R/parse_element.R line 225: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L225)
    pub_month_tmp2 = pub_date = date_idx = NULL 
  29. R/parse_element.R line 242: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L242)
    x2[is.na(pub_year), date_idx := regexpr('[0-9]{4}', medline_date)] 
  30. R/parse_element.R line 244: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L244)
    pub_year := as.integer(substr(medline_date, date_idx, date_idx + 3L))] 
  31. R/parse_element.R line 245: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L245)
    x2[, date_idx := NULL] 
  32. R/parse_element.R line 253: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L253)
    x2[, pub_month_tmp1 := tolower(pub_month)] 
  33. R/parse_element.R line 256: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L256)
    x3[, pub_day_tmp := pub_day] 
  34. R/parse_element.R line 257: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L257)
    x3[is.na(pub_day_tmp), pub_day_tmp := '01'] 
  35. R/parse_element.R line 259: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L259)
    pub_date := as.Date( 
  36. R/parse_element.R line 271: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L271)
    .N = NULL 
  37. R/parse_element.R line 289: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L289)
    indexing_method = .N = descriptor_pos = pmid = NULL 
  38. R/parse_element.R line 311: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L311)
    x3[, descriptor_pos := 1:.N, by = pmid] 
  39. R/parse_element.R line 313: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L313)
    x3[, descriptor_pos := ai]} 
  40. R/parse_element.R line 346: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L346)
    .N = NULL 
  41. R/parse_element.R line 373: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L373)
    .N = NULL 
  42. R/parse_element.R line 403: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L403)
    .N = NULL 
  43. R/parse_element.R line 424: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L424)
    .N = accession_number = NULL 
  44. R/parse_element.R line 441: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L441)
    x5[, accession_number := unlist(lapply(x3, xml_text))] 
  45. R/parse_element.R line 450: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L450)
    .N = NULL 
  46. R/parse_element.R line 468: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L468)
    .N = abstract_pos = copyright = pmid = NULL 
  47. R/parse_element.R line 484: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L484)
    x5[, abstract_pos := 1:.N, by = pmid] 
  48. R/parse_element.R line 486: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_element.R#L486)
    x5[, abstract_pos := as.integer()]} 
  49. R/parse_person.R line 4: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_person.R#L4)
    . = pmid = .N = equal_contrib = collective_name = person_pos  = 
  50. R/parse_person.R line 5: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_person.R#L5)
    affiliation_pos = affiliation = affil_idx = person_idx = n_affil_ids = 
  51. R/parse_person.R line 6: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_person.R#L6)
    n_person_ids = n_total_ids = id_pos = NULL 
  52. R/parse_person.R line 34: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_person.R#L34)
    dPerson[, equal_contrib := xml_attr(x2, 'EqualContrib')] 
  53. R/parse_person.R line 35: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_person.R#L35)
    dPerson[, collective_name := 
  54. R/parse_person.R line 39: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_person.R#L39)
    dPerson[, person_pos := 1:.N, by = pmid] 
  55. R/parse_person.R line 41: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_person.R#L41)
    dPerson[, person_pos := ai]} 
  56. R/parse_person.R line 50: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_person.R#L50)
    dAffil[, affiliation_pos := seq_len(.N), by = cols] 
  57. R/parse_person.R line 69: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_person.R#L69)
    dAffil[, affil_idx := 1:.N] 
  58. R/parse_person.R line 74: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_person.R#L74)
    dAffil[, affil_idx := NULL] 
  59. R/parse_person.R line 75: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_person.R#L75)
    dAffilId[, affil_idx := NULL] 
  60. R/parse_person.R line 98: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_person.R#L98)
    dPerson[, person_idx := 1:.N] 
  61. R/parse_person.R line 102: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_person.R#L102)
    dPerson[, person_idx := NULL] 
  62. R/parse_person.R line 103: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_person.R#L103)
    dAllId[, person_idx := NULL] 
  63. R/parse_person.R line 108: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_person.R#L108)
    x10[is.na(n_affil_ids), n_affil_ids := 0] 
  64. R/parse_person.R line 109: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_person.R#L109)
    x10[, n_person_ids := n_total_ids - n_affil_ids] 
  65. R/parse_person.R line 114: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_person.R#L114)
    dAllId[, id_pos := seq_len(.N), by = cols] 
  66. R/parse_person.R line 116: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_person.R#L116)
    dPersonId[, id_pos := NULL] 
  67. R/parse_pubmed_xml.R line 11: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_pubmed_xml.R#L11)
    status = xml_filename = parseFunc = NULL 
  68. R/parse_pubmed_xml.R line 34: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_pubmed_xml.R#L34)
    if (isEmpty(tableSuffix)) dPmid[, xml_filename := NULL] 
  69. R/parse_pubmed_xml.R line 60: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/parse_pubmed_xml.R#L60)
    xml_filename = filenameNow = NULL 
  70. R/utilities.R line 2: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/utilities.R#L2)
    status = xml_filename = NULL 
  71. R/utilities.R line 9: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/utilities.R#L9)
    . = xml_filename = NULL 
  72. R/utilities.R line 77: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/utilities.R#L77)
    . = xml_filename = step = NULL 
  73. R/utilities.R line 128: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/R/utilities.R#L128)
    paste_ = function(...) { 
  74. data-raw/clickhouse/compare_postgres_clickhouse.R line 6: Place a space before left parenthesis, except in a function call. (https://github.com/hugheylab/pmparser/blob/master/data-raw/clickhouse/compare_postgres_clickhouse.R#L6)
    for(table in tables){ 
  75. data-raw/clickhouse/compare_postgres_clickhouse.R line 6: There should be a space between right parenthesis and an opening curly brace. (https://github.com/hugheylab/pmparser/blob/master/data-raw/clickhouse/compare_postgres_clickhouse.R#L6)
    for(table in tables){ 
  76. data-raw/clickhouse/compare_postgres_clickhouse.R line 9: Place a space before left parenthesis, except in a function call. (https://github.com/hugheylab/pmparser/blob/master/data-raw/clickhouse/compare_postgres_clickhouse.R#L9)
    for(colname in colnames(dtP)){ 
  77. data-raw/clickhouse/compare_postgres_clickhouse.R line 9: There should be a space between right parenthesis and an opening curly brace. (https://github.com/hugheylab/pmparser/blob/master/data-raw/clickhouse/compare_postgres_clickhouse.R#L9)
    for(colname in colnames(dtP)){ 
  78. data-raw/clickhouse/compare_postgres_clickhouse.R line 10: Place a space before left parenthesis, except in a function call. (https://github.com/hugheylab/pmparser/blob/master/data-raw/clickhouse/compare_postgres_clickhouse.R#L10)
    if(inherits(dtP[[colname]], 'Date')){ 
  79. data-raw/clickhouse/compare_postgres_clickhouse.R line 10: There should be a space between right parenthesis and an opening curly brace. (https://github.com/hugheylab/pmparser/blob/master/data-raw/clickhouse/compare_postgres_clickhouse.R#L10)
    if(inherits(dtP[[colname]], 'Date')){ 
  80. data-raw/clickhouse/compare_postgres_clickhouse.R line 17: Place a space before left parenthesis, except in a function call. (https://github.com/hugheylab/pmparser/blob/master/data-raw/clickhouse/compare_postgres_clickhouse.R#L17)
    for(colname in colnames(dtC)){ 
  81. data-raw/clickhouse/compare_postgres_clickhouse.R line 17: There should be a space between right parenthesis and an opening curly brace. (https://github.com/hugheylab/pmparser/blob/master/data-raw/clickhouse/compare_postgres_clickhouse.R#L17)
    for(colname in colnames(dtC)){ 
  82. data-raw/clickhouse/compare_postgres_clickhouse.R line 18: There should be a space between right parenthesis and an opening curly brace. (https://github.com/hugheylab/pmparser/blob/master/data-raw/clickhouse/compare_postgres_clickhouse.R#L18)
    # if(inherits(dtC[[colname]], 'Date') || (colname == 'version' && table != 'pmid_status')){ 
  83. data-raw/clickhouse/compare_postgres_clickhouse.R line 19: Place a space before left parenthesis, except in a function call. (https://github.com/hugheylab/pmparser/blob/master/data-raw/clickhouse/compare_postgres_clickhouse.R#L19)
    if(inherits(dtC[[colname]], 'Date')){ 
  84. data-raw/clickhouse/compare_postgres_clickhouse.R line 19: There should be a space between right parenthesis and an opening curly brace. (https://github.com/hugheylab/pmparser/blob/master/data-raw/clickhouse/compare_postgres_clickhouse.R#L19)
    if(inherits(dtC[[colname]], 'Date')){ 
  85. data-raw/clickhouse/compare_postgres_clickhouse.R line 27: Place a space before left parenthesis, except in a function call. (https://github.com/hugheylab/pmparser/blob/master/data-raw/clickhouse/compare_postgres_clickhouse.R#L27)
    if(isTRUE(allEq)){ 
  86. data-raw/clickhouse/compare_postgres_clickhouse.R line 27: There should be a space between right parenthesis and an opening curly brace. (https://github.com/hugheylab/pmparser/blob/master/data-raw/clickhouse/compare_postgres_clickhouse.R#L27)
    if(isTRUE(allEq)){ 
  87. data-raw/clickhouse/compare_postgres_clickhouse.R line 36: Trailing blank lines are superfluous. (https://github.com/hugheylab/pmparser/blob/master/data-raw/clickhouse/compare_postgres_clickhouse.R#L36)
     
  88. data-raw/clickhouse/create_clickhouse_from_postgres.R line 1: There should be a space between right parenthesis and an opening curly brace. (https://github.com/hugheylab/pmparser/blob/master/data-raw/clickhouse/create_clickhouse_from_postgres.R#L1)
    createClickhouseFromPostgres = function(pgDbName = 'pmdbclick', clDbName = 'pmdbclick', chunkSize = 15000L){ 
  89. data-raw/clickhouse/create_clickhouse_from_postgres.R line 15: Lines should not be more than 120 characters. (https://github.com/hugheylab/pmparser/blob/master/data-raw/clickhouse/create_clickhouse_from_postgres.R#L15)
    parseNames = c(parseNames, list(citation = data.table::data.table(citing_pmid = as.integer(), cited_pmid = as.integer()), 
  90. data-raw/clickhouse/create_clickhouse_from_postgres.R line 16: Lines should not be more than 120 characters. (https://github.com/hugheylab/pmparser/blob/master/data-raw/clickhouse/create_clickhouse_from_postgres.R#L16)
    citation_version = data.table::data.table(md5_computed = as.character(), pmparser_version = as.character(), datetime_processed = as.POSIXct(as.character())))) 
  91. data-raw/clickhouse/create_clickhouse_from_postgres.R line 29: Place a space before left parenthesis, except in a function call. (https://github.com/hugheylab/pmparser/blob/master/data-raw/clickhouse/create_clickhouse_from_postgres.R#L29)
    if(!(tableName %in% verExclude)) colNamesDT[,version := NULL] 
  92. data-raw/clickhouse/create_clickhouse_from_postgres.R line 29: Commas should always have a space after. (https://github.com/hugheylab/pmparser/blob/master/data-raw/clickhouse/create_clickhouse_from_postgres.R#L29)
    if(!(tableName %in% verExclude)) colNamesDT[,version := NULL] 
  93. data-raw/clickhouse/create_clickhouse_from_postgres.R line 30: Put spaces around all infix operators. (https://github.com/hugheylab/pmparser/blob/master/data-raw/clickhouse/create_clickhouse_from_postgres.R#L30)
    colOrder = paste(colnames(colNamesDT), collapse=', ') 
  94. data-raw/clickhouse/create_clickhouse_from_postgres.R line 33: Place a space before left parenthesis, except in a function call. (https://github.com/hugheylab/pmparser/blob/master/data-raw/clickhouse/create_clickhouse_from_postgres.R#L33)
    for(rowOff in 0:(totalRows %/% chunkSize)) { 
  95. data-raw/clickhouse/create_clickhouse_from_postgres.R line 36: Lines should not be more than 120 characters. (https://github.com/hugheylab/pmparser/blob/master/data-raw/clickhouse/create_clickhouse_from_postgres.R#L36)
    dTable = data.table::as.data.table(DBI::dbGetQuery(pCon, glue('SELECT * FROM {`tableName`} ORDER BY {`colOrder`} LIMIT {`chunkSize`} OFFSET {`off`}'))) 
  96. data-raw/clickhouse/create_clickhouse_from_postgres.R line 47: Trailing blank lines are superfluous. (https://github.com/hugheylab/pmparser/blob/master/data-raw/clickhouse/create_clickhouse_from_postgres.R#L47)
     
  97. tests/testthat/test_get_pubmed_files.R line 31: Variable and function name style should be camelCase. (https://github.com/hugheylab/pmparser/blob/master/tests/testthat/test_get_pubmed_files.R#L31)
    fileInfo[, md5_match := as.numeric(md5_match)] 
  98. vignettes/data_dictionary.Rmd line 13: Only use single-quotes. (https://github.com/hugheylab/pmparser/blob/master/vignettes/data_dictionary.Rmd#L13)
    comment = "#>"