Skip to content
This repository has been archived by the owner on Jul 23, 2023. It is now read-only.

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

Open
maurolepore opened this issue Oct 4, 2018 · 5 comments
Open

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

maurolepore opened this issue Oct 4, 2018 · 5 comments
Labels
help wanted Extra attention is needed

Comments

@maurolepore
Copy link
Contributor

maurolepore commented Oct 4, 2018

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

image

@maurolepore
Copy link
Contributor Author

maurolepore commented Oct 4, 2018

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
Copy link
Contributor Author

maurolepore commented Oct 4, 2018

@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
Copy link
Contributor Author

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
  'bigll3C�B!' in object 'WSG'
  'pequeC�B1a' in object 'WSG'

@maurolepore
Copy link
Contributor Author

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
Copy link
Contributor Author

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

maurolepore added a commit that referenced this issue Oct 4, 2018
* Remove old documentation.
* Add dummy test to avoid CMD R check error.
* Replace bad object on data/.
@maurolepore maurolepore changed the title Fix errors, warnings and notes after running devtools::check(). Fix warnings and notes after running devtools::check(). Oct 15, 2018
@maurolepore maurolepore added the help wanted Extra attention is needed label Oct 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant