forestgeo / AGBfluxes

Compute flux of biomass at ForestGEO sites.
https://forestgeo.github.io/AGBfluxes/
GNU General Public License v3.0
2 stars 1 forks source link

Fix warnings and notes after running devtools::check(). #22

Open maurolepore opened 5 years ago

maurolepore commented 5 years ago

I'll refer to this issue as I address problems identified with devtools::check().

image

maurolepore commented 5 years ago

I replaced data/barro colorado island_formated_data.Rdata with data/DF.

I replace it because the name is long, has spaces, and doesn't match the name of the object that it contains. Also, the format .Rdata throws a warning with devtools::check():

checking contents of 'data' directory ... WARNING
Files not of a type allowed in a 'data' directory:
 'barro colorado island_formated_data.Rdata'

Also:

checking for portable file names ... WARNING
Found the following file with a non-portable file name:
  data/barro colorado island_formated_data.Rdata
These are not fully portable file names.

Please document this dataset in R/data.R

image

maurolepore commented 5 years ago

@ervanSTRI, please use the messages from devtools::check() to identify arguments that you haven't yet documented and to remove arguments that you no longer use. This is a relatively easy fix, and will remove one warning.

* checking Rd \usage sections ... WARNING
Undocumented arguments in documentation object 'assignAGB'
  'DAT' 'DBH'
Documented arguments not in \usage in documentation object 'assignAGB':
  'site' 'D' 'WD'

Undocumented arguments in documentation object 'assignWD'
  'DAT' 'WD'
Documented arguments not in \usage in documentation object 'assignWD':
  'df' 'site' 'wsgdata' 'denscol'
...
maurolepore commented 5 years ago

This warning is a difficult to fix. Your datasets have non-ASCII characters and it may not be possible to replace them with ASCII characters. I've faced this problem before and I haven't figured out how to fix it.

* checking data for non-ASCII characters ... WARNING
  Warning: found non-ASCII strings
  'bigll3CB!' in object 'WSG'
  'pequeCB1a' in object 'WSG'
maurolepore commented 5 years ago

Notes are less important to fix but it's good practice to try aim for 0 errors, 0 warnings, and 0 notes. This is the general requirement to submit to CRAN. Functions that use non-standard evaluation commonly cause this notes. For variables used in ggplot2, for example, you can fix this by refering to .data$x instead of x. I don't know if data.table has a pronoun similar to .data. In any case, you can silent this note using: globalVariables(c("global-variable1", "global-variable2", "...")). A good place to place this is in R/imports.R.

checking R code for possible problems ... NOTE
LOAD: warning in objects(env, all = TRUE): partial argument match of
  'all' to 'all.names'
assignAGB: no visible binding for global variable 'df'
assignAGB: no visible binding for global variable '..height'
assignAGB: no visible binding for global variable 'site'
assignAGB: no visible binding for global variable 'site.info'
assignWD: no visible binding for global variable 'DATA_path'
assignWD: no visible binding for '<<-' assignment to 'DATA_path'
assignWD: no visible binding for global variable 'path_folder'
... 104 lines ...
maurolepore commented 5 years ago

Now we are down to 0 errors, 2 warnings, and 1 note. As I said above, 1 warning and 1 note are easy to fix. The challenge will be one last warning about non-ASCII characters in datasets.

image