Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRAN submission. #81

Open
grabear opened this issue Feb 19, 2019 · 9 comments
Open

CRAN submission. #81

grabear opened this issue Feb 19, 2019 · 9 comments

Comments

@grabear
Copy link
Member

grabear commented Feb 19, 2019

We can use this issue to discuss anything related to CRAN submission including any feedback that we might get.

#79 is also going to contain some commits so that we can submit to CRAN.

@grabear
Copy link
Member Author

grabear commented Feb 20, 2019

@sdhutchins
I've done a lot of work this afternoon to get the regular build check to work (e.g. devtools::check())

After I get a few minor things fixed I'm going to run R CMD check --as-cran, and then try running our package through Rhub or Winbuilder .

@grabear
Copy link
Member Author

grabear commented Feb 20, 2019

@sdhutchins Any hot tips on how to prevent this:

Warning: replacing previous import 'scales::alpha' by 'microbiome::alpha' when loading 'MicrobiomeR'

or this:

Package suggested but not available for checking: 'covr'

@sdhutchins
Copy link
Contributor

@sdhutchins Any hot tips on how to prevent this:

Warning: replacing previous import 'scales::alpha' by 'microbiome::alpha' when loading 'MicrobiomeR'

or this:

Package suggested but not available for checking: 'covr'

One way with scales is to @import scales instead of @importFrom scales alpha

@sdhutchins
Copy link
Contributor

For covr, I'm not sure. I don't think covr is on cran.

@grabear
Copy link
Member Author

grabear commented Feb 20, 2019

This is an increadibly annoying Note that occurs when using NSE:

> checking R code for possible problems ... NOTE

 convert_proportions: no visible binding for global variable 'SampleID'
  convert_proportions: no visible binding for global variable 'Abundance'
  convert_proportions: no visible global function definition for ':='
  convert_proportions: no visible binding for global variable
    'TreatmentGroup'
  correlation_data: no visible binding for global variable 'treatment_1'
  correlation_data: no visible binding for global variable 'treatment_2'
  correlation_data: no visible binding for global variable
    'wilcox_p_value'
  correlation_data: no visible binding for global variable 'Significance'
  correlation_data: no visible binding for global variable
    'log2_mean_ratio'
  correlation_data: no visible binding for global variable 'label'
  correlation_data: no visible binding for global variable '.'
  correlation_plot: no visible binding for global variable 'mean_treat2'
  correlation_plot: no visible binding for global variable 'mean_treat1'
  correlation_plot: no visible binding for global variable 'Abundance'
  correlation_plot: no visible binding for global variable
    'color_wilcox_p_value'
  correlation_plot: no visible binding for global variable 'rank_label'
  heat_tree_parameters: no visible binding for global variable
    'log2_mean_ratio'
  heat_tree_parameters: no visible binding for global variable
    'wilcox_p_value'
  heat_tree_plots: no visible binding for global variable 'n_supertaxa'
  melt_taxmap: no visible binding for global variable 'X.SampleID'
  melt_taxmap: no visible binding for global variable 'otu_id'
  otu_id_filter: no visible binding for global variable 'otu_id'
  otu_prevalence_filter: no visible binding for global variable
    'n_samples'
  permanova: no visible global function definition for 'as.formula'
  permanova: no visible global function definition for 'anova'
  permanova: no visible global function definition for 'coefficients'
  sample_id_filter: no visible binding for global variable 'sample_id'
  stacked_barplot: no visible global function definition for ':='
  stacked_barplot: no visible binding for global variable 'SampleID'
  stacked_barplot: no visible binding for global variable
    'Relative.Abundance'
  taxa_prevalence_filter: no visible binding for global variable
    'n_samples'
  top_coefficients_barplot: no visible global function definition for
    'par'
  top_coefficients_barplot: no visible global function definition for
    'barplot'
  transformer: no visible binding for global variable '.'
  transposer: no visible binding for global variable '.'
  Undefined global functions or variables:
    . := Abundance Relative.Abundance SampleID Significance
    TreatmentGroup X.SampleID anova as.formula barplot coefficients
    color_wilcox_p_value label log2_mean_ratio mean_treat1 mean_treat2
    n_samples n_supertaxa otu_id par rank_label sample_id treatment_1
    treatment_2 wilcox_p_value
  Consider adding
    importFrom("graphics", "barplot", "par")
    importFrom("stats", "anova", "as.formula", "coefficients")
  to your NAMESPACE file.

Solutions include:

  1. https://dplyr.tidyverse.org/articles/programming.html#different-data-sets

If this function is in a package, using .data also prevents R CMD check from giving a NOTE about undefined global variables (provided that you’ve also imported rlang::.data with @importFrom rlang .data).

  1. Writing R Packages: no visible binding for global variable STAT545-UBC/Discussion#451 (comment)

quiets concerns of R CMD check re: the .'s that appear in pipelines
if(getRversion() >= "2.15.1") utils::globalVariables(c("."))

@sdhutchins probably going to try the first one. It seems more elegant (even though it will take longer..). However if that doesnt work we can just do number 2. What do you think?

@grabear
Copy link
Member Author

grabear commented Feb 20, 2019

For covr, I'm not sure. I don't think covr is on cran.

Should it be in the Remotes: field in the DESCRIPTION file?

@sdhutchins
Copy link
Contributor

Maybe?
If it's only in Suggests, I'm not sure.

@grabear
Copy link
Member Author

grabear commented Feb 20, 2019

I tried, and I don't think it worked.

@grabear
Copy link
Member Author

grabear commented Feb 20, 2019

I'm going to try putting it in the Imports field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants