SpaceGold / apple_mobility_data

0 stars 0 forks source link

All lintr errors need to be resolved #5

Closed naupaka closed 4 years ago

naupaka commented 4 years ago

To check everything, use lintr::lint_dir(pattern = rex::rex(".", or("R", "r", "Rmd", "rmd"), end))

> lintr::lint_dir(pattern = rex::rex(".", or("R", "r", "Rmd", "rmd"), end))
........
Analysis.Rmd:138:1: style: Lines should not be more than 80 characters.
# on the y axis. The first graph should be from January and the second graph # # should be aggregate from March to April
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
code/functions/count_counties_cities.R:11:21: warning: no visible global function definition for ‘read_csv’
  subregion_data <- read_csv(file_name_in)
                    ^~~~~~~~
code/functions/count_counties_cities.R:26:1: style: Lines should not be more than 80 characters.
          paste("output/subsetted_states_tallied/", state_no_spaces, "_cities_counties_counts.csv", sep = ""))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
code/functions/flip_dataset.R:11:18: warning: no visible global function definition for ‘read_csv’
  our_dataset <- read_csv(file_name_in)
                 ^~~~~~~~
code/functions/flip_dataset.R:33:3: warning: no visible global function definition for ‘write_csv’
  write_csv(final_dataset, fp)
  ^~~~~~~~~
code/functions/subset_mobility_data_to_state.R:12:21: warning: no visible global function definition for ‘read_csv’
  all_covid_data <- read_csv(input_filename)
                    ^~~~~~~~
code/functions/subset_mobility_data_to_state.R:26:40: style: Commas should always have a space after.
                             subregion,"_", core_name, ".csv")
                                       ^
code/functions/subset_mobility_data_to_state.R:27:3: warning: no visible global function definition for ‘write_csv’
  write_csv(output_data, full_output_path)
  ^~~~~~~~~
code/temp/test.R:1:16: style: Use <-, not =, for assignment.
input_filename = global_file_to_process
               ^
code/temp/test.R:2:11: style: Use <-, not =, for assignment.
subregion = state_to_analyze
          ^
code/temp/test.R:19:38: style: Commas should always have a space after.
                           subregion,"_", core_name, ".csv")
                                     ^
Warning messages:
1: In readLines(filename) :
  incomplete final line found on '/Users/naupaka/Desktop/apple_mobility_data/code/temp/test.R'
2: In readLines(file) :
  incomplete final line found on '/Users/naupaka/Desktop/apple_mobility_data/code/temp/test.R'
naupaka commented 4 years ago

@SpaceGold checking in on the status of this issue?

SpaceGold commented 4 years ago

Thanks - I've addressed the lint, but I don't sufficiently understand the warning: no visible global function definition for ‘write_csv’ issue. Google suggests something about namespace, but that's for packages. Could you perhaps point me toward a lecture or something I'm missing, to make variables global? Edit: solved via Slack: add pkg syntax.

naupaka commented 4 years ago

@SpaceGold please don't close until we've had a chance to verify that it's resolved

naupaka commented 4 years ago

ok all good! ✅