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

R-CMD Check: no visible binding for global variable #4

Open
the-mayer opened this issue Aug 29, 2024 · 17 comments
Open

R-CMD Check: no visible binding for global variable #4

the-mayer opened this issue Aug 29, 2024 · 17 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers outreachy for outreachy interns package R package dev

Comments

@the-mayer
Copy link
Collaborator

the-mayer commented Aug 29, 2024

Overview

Be explicit in all function calls. Utilize rlang::.data as appropriate, checking functions off the list as they have been updated.

Function List

  • BinaryDomainNetwork: no visible binding for global variable ‘id’
  • BinaryDomainNetwork: no visible binding for global variable ‘size’
  • BinaryDomainNetwork: no visible binding for global variable ‘width’
  • GenContextNetwork: no visible binding for global variable ‘size’
  • GenContextNetwork: no visible binding for global variable ‘width’
  • LineagePlot: no visible binding for global variable ‘GenContext’
  • LineagePlot: no visible binding for global variable ‘Lineage’
  • LineagePlot: no visible binding for global variable ‘Query’
  • LineagePlot: no visible binding for global variable ‘ReducedLin’
  • LineagePlot: no visible binding for global variable ‘Kingdom’
  • add_leaves: no visible binding for global variable ‘x1’
  • add_leaves: no visible binding for global variable ‘AccNum’
  • add_leaves: no visible binding for global variable ‘Alignment’
  • add_leaves: no visible binding for global variable ‘Species’
  • add_leaves: no visible binding for global variable ‘Lineage’
  • add_leaves: no visible binding for global variable ‘Kingdom’
  • add_leaves: no visible binding for global variable ‘Phylum’
  • add_leaves: no visible binding for global variable ‘Genus’
  • add_leaves: no visible binding for global variable ‘Spp’
  • add_leaves: no visible binding for global variable ‘Leaf’
  • add_leaves: no visible binding for global variable ‘Leaf_Acc’
  • add_lins: no visible global function definition for ‘:=’
  • add_name: no visible binding for global variable ‘Kingdom’
  • add_name: no visible binding for global variable ‘Phylum’
  • add_name: no visible binding for global variable ‘Genus’
  • add_name: no visible binding for global variable ‘Spp’
  • add_tax: no visible global function definition for ‘is.data.table’
  • add_tax: no visible global function definition for ‘:=’
  • add_tax: no visible binding for global variable ‘AccNum.noV’
  • add_tax: no visible global function definition for ‘merge.data.table’
  • all_non_n_cols_to_char: no visible global function definition for ‘matches’
  • clean_clust_file: no visible binding for global variable ‘X1’
  • clean_clust_file: no visible binding for global variable ‘colnames.op_ins_cls’
  • clean_clust_file: no visible binding for global variable ‘AccNum’
  • cleanup_clust: no visible binding for global variable ‘ClustName’
  • combine_files: no visible global function definition for ‘col_character’
  • convert_aln2fa: no visible global function definition for ‘data.table’
  • count_bycol: no visible binding for global variable ‘freq’
  • create_lineage_lookup: no visible binding for global variable ‘kingdom’
  • create_lineage_lookup: no visible binding for global variable ‘Lineage’
  • create_one_col_params: no visible binding for global variable ‘.’
  • create_one_col_params: no visible binding for global variable ‘ids’
  • create_one_col_params: no visible binding for global variable ‘parents’
  • create_one_col_params: no visible binding for global variable ‘values’
  • create_one_col_params: no visible binding for global variable ‘hovertext’
  • df_iprscan_domains2fasta: no visible binding for global variable ‘seq_domain’
  • df_iprscan_domains2fasta: no visible binding for global variable ‘id_domain’
  • domain_network: no visible binding for global variable ‘DomArch.ntwrk’
  • domain_network: no visible binding for global variable ‘words’
  • domain_network: no visible binding for global variable ‘freq’
  • domain_network: no visible global function definition for ‘V<-’
  • domain_network: no visible global function definition for ‘E<-’
  • domain_network : <anonymous>: no visible global function definition for ‘E<-’
  • filter_freq: no visible binding for global variable ‘freq’
  • find_paralogs: no visible binding for global variable ‘Lineage’
  • find_paralogs: no visible binding for global variable ‘GCA_ID’
  • find_paralogs: no visible binding for global variable ‘DomArch’
  • find_paralogs : : no visible binding for global variable ‘GCA_ID’
  • find_paralogs: no visible binding for global variable ‘Species’
  • find_paralogs: no visible binding for global variable ‘Count’
  • find_top_acc: no visible binding for global variable ‘PcPositive’
  • find_top_acc: no visible binding for global variable ‘AccNum’
  • format_job_args: no visible binding for global variable ‘tags’
  • format_job_args : : no visible binding for global variable ‘fields_metadata’
  • format_job_args : : no visible binding for global variable ‘tags’
  • gc_undirected_network: no visible binding for global variable ‘totallin’
  • gc_undirected_network: no visible global function definition for ‘V<-’
  • gc_undirected_network: no visible global function definition for ‘E<-’
  • gc_undirected_network : : no visible global function definition for ‘E<-’
  • generate_fa2tre: no visible binding for global variable ‘tre_path’
  • generate_fa2tre: no visible binding for global variable ‘prot’
  • generate_fa2tre: no visible global function definition for ‘midpoint’
  • generate_msa: possible error in readAAStringSet(path = fa_file, format = "fasta"): unused argument (path = fa_file)
  • generate_msa: no visible global function definition for ‘kalign’
  • getJobsWithStates: no visible binding for global variable ‘state’
  • get_proc_medians : : no visible global function definition for ‘median’
  • ipg2lin: no visible binding for global variable ‘Protein’
  • ipg2lin: no visible binding for global variable ‘mergedTax’
  • ipg2lin: no visible binding for global variable ‘gca_ipg_dt’
  • ipg2lin: no visible binding for global variable ‘assembly_path’
  • ipg2lin: no visible binding for global variable ‘Lineage’
  • ipr2viz: no visible binding for global variable ‘iprscan_cols’
  • ipr2viz: no visible binding for global variable ‘Name’
  • ipr2viz: no visible binding for global variable ‘Lineage_short’
  • ipr2viz: no visible binding for global variable ‘QueryName’
  • ipr2viz: no visible binding for global variable ‘PcPositive’
  • ipr2viz: no visible binding for global variable ‘AccNum’
  • ipr2viz: no visible binding for global variable ‘StartLoc’
  • ipr2viz: no visible binding for global variable ‘StopLoc’
  • ipr2viz: no visible binding for global variable ‘Analysis’
  • ipr2viz: no visible binding for global variable ‘lookup_table_cols’
  • ipr2viz: no visible binding for global variable ‘ShortName’
  • ipr2viz: no visible global function definition for ‘unit’
  • ipr2viz: no visible binding for global variable ‘SLength’
  • ipr2viz: no visible global function definition for ‘as.formula’
  • ipr2viz_web: no visible binding for global variable ‘lookup_table_cols’
  • ipr2viz_web: no visible binding for global variable ‘Name’
  • ipr2viz_web: no visible binding for global variable ‘AccNum’
  • ipr2viz_web: no visible binding for global variable ‘StartLoc’
  • ipr2viz_web: no visible binding for global variable ‘StopLoc’
  • ipr2viz_web: no visible binding for global variable ‘Analysis’
  • ipr2viz_web: no visible binding for global variable ‘ShortName’
  • ipr2viz_web: no visible global function definition for ‘unit’
  • ipr2viz_web: no visible binding for global variable ‘SLength’
  • ipr2viz_web: no visible global function definition for ‘as.formula’
  • lineage.DA.plot: no visible binding for global variable ‘Lineage’
  • lineage.DA.plot: no visible binding for global variable ‘totalcount’
  • lineage.domain_repeats.plot: no visible binding for global variable ‘query.DAdoms’
  • lineage.domain_repeats.plot: no visible binding for global variable ‘DomArch.norep’
  • lineage.domain_repeats.plot: no visible binding for global variable ‘Lineage’
  • lineage.domain_repeats.plot: no visible binding for global variable ‘GenContext.norep’
  • lineage.domain_repeats.plot: no visible binding for global variable ‘SIG.TM.LADB’
  • lineage.domain_repeats.plot: no visible binding for global variable ‘GenContext’
  • lineage.domain_repeats.plot: no visible binding for global variable ‘AccNum’
  • lineage.domain_repeats.plot: no visible binding for global variable ‘domains’
  • lineage.neighbors.plot: no visible binding for global variable ‘lincount’
  • lineage_sunburst: no visible global function definition for ‘d3_nest’
  • lineage_sunburst: no visible binding for global variable ‘cpcols’
  • lineage_sunburst: no visible global function definition for ‘sund2b’
  • make_accnums_unique: no visible binding for global variable ‘accnum’
  • make_accnums_unique: no visible binding for global variable ‘suffix’
  • make_accnums_unique: no visible binding for global variable ‘accnum_adjusted’
  • make_df_iprscan_domains: no visible binding for global variable ‘Analysis’
  • make_df_iprscan_domains: no visible binding for global variable ‘AccNum’
  • make_df_iprscan_domains: no visible binding for global variable ‘StartLoc’
  • make_df_iprscan_domains: no visible binding for global variable ‘StopLoc’
  • make_df_iprscan_domains: no visible binding for global variable ‘id_domain’
  • pick_longer_duplicate: no visible binding for global variable ‘AccNum’
  • pick_longer_duplicate: no visible binding for global variable ‘row.orig’
  • plot_estimated_walltimes : get_powerset : : no visible global function definition for ‘combn’
  • plot_estimated_walltimes: no visible binding for global variable ‘n_inputs’
  • plot_estimated_walltimes: no visible binding for global variable ‘est_walltime’
  • plot_estimated_walltimes: no visible binding for global variable ‘advanced_opts’
  • remove_tails: no visible binding for global variable ‘domains_keep’
  • repeat2s: no visible binding for global variable ‘.’
  • stacked_lin_plot: no visible binding for global variable ‘cpcols’
  • stacked_lin_plot: no visible global function definition for ‘unit’
  • summ.DA: no visible binding for global variable ‘DomArch’
  • summ.DA: no visible binding for global variable ‘totallin’
  • summ.DA: no visible binding for global variable ‘totalcount’
  • summ.DA.byLin: no visible binding for global variable ‘DomArch’
  • summ.DA.byLin: no visible binding for global variable ‘Lineage’
  • summ.GC: no visible binding for global variable ‘GenContext’
  • summ.GC: no visible binding for global variable ‘DomArch’
  • summ.GC: no visible binding for global variable ‘Lineage’
  • summ.GC: no visible binding for global variable ‘totalcount’
  • summ.GC: no visible binding for global variable ‘totalDA’
  • summ.GC: no visible binding for global variable ‘totallin’
  • summ.GC.byDALin: no visible binding for global variable ‘GenContext’
  • summ.GC.byDALin: no visible binding for global variable ‘DomArch’
  • summ.GC.byDALin: no visible binding for global variable ‘Lineage’
  • summ.GC.byLin: no visible binding for global variable ‘GenContext’
  • summ.GC.byLin: no visible binding for global variable ‘DomArch’
  • summ.GC.byLin: no visible binding for global variable ‘Lineage’
  • total_counts: no visible binding for global variable ‘totalcount’
  • total_counts: no visible binding for global variable ‘CumulativePercent’
  • upset.plot: no visible binding for global variable ‘Words’
  • upset.plot: no visible binding for global variable ‘AccNum’
  • upset.plot: no visible binding for global variable ‘Lineage’
  • upset.plot: no visible global function definition for ‘par’
  • wordcloud2_element: no visible binding for global variable ‘freq’
  • wordcloud2_element: no visible binding for global variable ‘words’
  • wordcloud2_element: no visible binding for global variable ‘label’
  • words2wc: no visible binding for global variable ‘words’
  • words2wc: no visible binding for global variable ‘freq’
  • write_proc_medians_table: no visible binding for global variable ‘median_seconds’
@the-mayer the-mayer added the enhancement New feature or request label Aug 29, 2024
@the-mayer the-mayer self-assigned this Aug 29, 2024
@jananiravi
Copy link
Member

@SunSummoner, this might be a good place to start. @the-mayer has started working on this for now.

@jananiravi jananiravi added good first issue Good for newcomers outreachy for outreachy interns labels Oct 1, 2024
@SunSummoner
Copy link
Collaborator

@jananiravi @the-mayer I will start with this. Thanks!

@valentina-buoro
Copy link
Collaborator

Hi @jananiravi , can I work on this?

@jananiravi
Copy link
Member

yes, please! coordinate with @SunSummoner via github/slack to see if she's started some work already.

@SunSummoner
Copy link
Collaborator

@jananiravi I talked with @valentina-buoro and we were thinking of dividing some of the functions after getting the PR reviewed for changes.

@jananiravi jananiravi added the package R package dev label Oct 4, 2024
@the-mayer
Copy link
Collaborator Author

the-mayer commented Oct 5, 2024

Splitting the remainder (roughly) by function(s), so that multiple people may participate!

Note, most of these errors come from how R handles Non Standard Evaluation. Resolving these issues does not actually change code functionality. It will however, clear a R CMD warning, which will be important for when MolEvolvR is submitted for review. Consider the following example:

filter_function <- function(data, filter_value) {
  data %>%
    filter(numeric_column_in_data < filter_value)
  }

R knows that numeric_column_in_data can be found within the data object. But, if this code were to be written in an R package, when running devtools:check() a warning would be produced:

filter_function: no visible binding for global variable 'numeric_column_in_data'

rlang, the package that helps with NSE offers a way to deal with this, by making the function code (within a package) more explicit. By refactoring to include a .data prefix, we can clear the warning:

filter_function <- function(data, filter_value) {
  data %>%
    filter(.data$numeric_column_in_data < filter_value)
  }

Please take the comments that follow, convert to an issue, then follow the contributing guidelines and create a new branch containing your changes. Commit your work, and submit a PR when ready for review.

@the-mayer
Copy link
Collaborator Author

  • generate_fa2tre: no visible binding for global variable ‘tre_path’
  • generate_fa2tre: no visible binding for global variable ‘prot’
  • generate_fa2tre: no visible global function definition for ‘midpoint’

Note, in addition to undefined global variables, this function will need to declare an import for midpoint

@the-mayer
Copy link
Collaborator Author

  • getJobsWithStates: no visible binding for global variable ‘state’
  • get_proc_medians : : no visible global function definition for ‘median’
  • ipg2lin: no visible binding for global variable ‘Protein’
  • ipg2lin: no visible binding for global variable ‘mergedTax’
  • ipg2lin: no visible binding for global variable ‘gca_ipg_dt’
  • ipg2lin: no visible binding for global variable ‘assembly_path’
  • ipg2lin: no visible binding for global variable ‘Lineage’

@the-mayer
Copy link
Collaborator Author

the-mayer commented Oct 5, 2024

  • ipr2viz: no visible binding for global variable ‘iprscan_cols’
  • ipr2viz: no visible binding for global variable ‘Name’
  • ipr2viz: no visible binding for global variable ‘Lineage_short’
  • ipr2viz: no visible binding for global variable ‘QueryName’
  • ipr2viz: no visible binding for global variable ‘PcPositive’
  • ipr2viz: no visible binding for global variable ‘AccNum’
  • ipr2viz: no visible binding for global variable ‘StartLoc’
  • ipr2viz: no visible binding for global variable ‘StopLoc’
  • ipr2viz: no visible binding for global variable ‘Analysis’
  • ipr2viz: no visible binding for global variable ‘lookup_table_cols’
  • ipr2viz: no visible binding for global variable ‘ShortName’
  • ipr2viz: no visible global function definition for ‘unit’
  • ipr2viz: no visible binding for global variable ‘SLength’
  • ipr2viz: no visible global function definition for ‘as.formula’
  • ipr2viz_web: no visible binding for global variable ‘lookup_table_cols’
  • ipr2viz_web: no visible binding for global variable ‘Name’
  • ipr2viz_web: no visible binding for global variable ‘AccNum’
  • ipr2viz_web: no visible binding for global variable ‘StartLoc’
  • ipr2viz_web: no visible binding for global variable ‘StopLoc’
  • ipr2viz_web: no visible binding for global variable ‘Analysis’
  • ipr2viz_web: no visible binding for global variable ‘ShortName’
  • ipr2viz_web: no visible global function definition for ‘unit’
  • ipr2viz_web: no visible binding for global variable ‘SLength’
  • ipr2viz_web: no visible global function definition for ‘as.formula’

@the-mayer
Copy link
Collaborator Author

  • lineage.DA.plot: no visible binding for global variable ‘Lineage’
  • lineage.DA.plot: no visible binding for global variable ‘totalcount’
  • lineage.domain_repeats.plot: no visible binding for global variable ‘query.DAdoms’
  • lineage.domain_repeats.plot: no visible binding for global variable ‘DomArch.norep’
  • lineage.domain_repeats.plot: no visible binding for global variable ‘Lineage’
  • lineage.domain_repeats.plot: no visible binding for global variable ‘GenContext.norep’
  • lineage.domain_repeats.plot: no visible binding for global variable ‘SIG.TM.LADB’
  • lineage.domain_repeats.plot: no visible binding for global variable ‘GenContext’
  • lineage.domain_repeats.plot: no visible binding for global variable ‘AccNum’
  • lineage.domain_repeats.plot: no visible binding for global variable ‘domains’

@the-mayer
Copy link
Collaborator Author

the-mayer commented Oct 5, 2024

  • lineage.neighbors.plot: no visible binding for global variable ‘lincount’
  • lineage_sunburst: no visible global function definition for ‘d3_nest’
  • lineage_sunburst: no visible binding for global variable ‘cpcols’
  • lineage_sunburst: no visible global function definition for ‘sund2b’
  • make_accnums_unique: no visible binding for global variable ‘accnum’
  • make_accnums_unique: no visible binding for global variable ‘suffix’
  • make_accnums_unique: no visible binding for global variable ‘accnum_adjusted’
  • make_df_iprscan_domains: no visible binding for global variable ‘Analysis’
  • make_df_iprscan_domains: no visible binding for global variable ‘AccNum’
  • make_df_iprscan_domains: no visible binding for global variable ‘StartLoc’
  • make_df_iprscan_domains: no visible binding for global variable ‘StopLoc’
  • make_df_iprscan_domains: no visible binding for global variable ‘id_domain’

@the-mayer
Copy link
Collaborator Author

the-mayer commented Oct 5, 2024

  • pick_longer_duplicate: no visible binding for global variable ‘AccNum’
  • pick_longer_duplicate: no visible binding for global variable ‘row.orig’
  • plot_estimated_walltimes : get_powerset : : no visible global function definition for ‘combn’
  • plot_estimated_walltimes: no visible binding for global variable ‘n_inputs’
  • plot_estimated_walltimes: no visible binding for global variable ‘est_walltime’
  • plot_estimated_walltimes: no visible binding for global variable ‘advanced_opts’
  • remove_tails: no visible binding for global variable ‘domains_keep’
  • repeat2s: no visible binding for global variable ‘.’
  • stacked_lin_plot: no visible binding for global variable ‘cpcols’
  • stacked_lin_plot: no visible global function definition for ‘unit’

@the-mayer
Copy link
Collaborator Author

  • summ.DA: no visible binding for global variable ‘DomArch’
  • summ.DA: no visible binding for global variable ‘totallin’
  • summ.DA: no visible binding for global variable ‘totalcount’
  • summ.DA.byLin: no visible binding for global variable ‘DomArch’
  • summ.DA.byLin: no visible binding for global variable ‘Lineage’
  • summ.GC: no visible binding for global variable ‘GenContext’
  • summ.GC: no visible binding for global variable ‘DomArch’
  • summ.GC: no visible binding for global variable ‘Lineage’
  • summ.GC: no visible binding for global variable ‘totalcount’
  • summ.GC: no visible binding for global variable ‘totalDA’
  • summ.GC: no visible binding for global variable ‘totallin’
  • summ.GC.byDALin: no visible binding for global variable ‘GenContext’
  • summ.GC.byDALin: no visible binding for global variable ‘DomArch’
  • summ.GC.byDALin: no visible binding for global variable ‘Lineage’
  • summ.GC.byLin: no visible binding for global variable ‘GenContext’
  • summ.GC.byLin: no visible binding for global variable ‘DomArch’
  • summ.GC.byLin: no visible binding for global variable ‘Lineage’

@the-mayer
Copy link
Collaborator Author

  • total_counts: no visible binding for global variable ‘totalcount’
  • total_counts: no visible binding for global variable ‘CumulativePercent’
  • upset.plot: no visible binding for global variable ‘Words’
  • upset.plot: no visible binding for global variable ‘AccNum’
  • upset.plot: no visible binding for global variable ‘Lineage’
  • upset.plot: no visible global function definition for ‘par’
  • wordcloud2_element: no visible binding for global variable ‘freq’
  • wordcloud2_element: no visible binding for global variable ‘words’
  • wordcloud2_element: no visible binding for global variable ‘label’
  • words2wc: no visible binding for global variable ‘words’
  • words2wc: no visible binding for global variable ‘freq’
  • write_proc_medians_table: no visible binding for global variable ‘median_seconds’

@valentina-buoro
Copy link
Collaborator

Splitting the remainder (roughly) by function(s), so that multiple people may participate!

Note, most of these errors come from how R handles Non Standard Evaluation. Resolving these issues does not actually change code functionality. It will however, clear a R CMD warning, which will be important for when MolEvolvR is submitted for review. Consider the following example:

filter_function <- function(data, filter_value) {
  data %>%
    filter(numeric_column_in_data < filter_value)
  }

R knows that numeric_column_in_data can be found within the data object. But, if this code were to be written in an R package, when running devtools:check() a warning would be produced:

filter_function: no visible binding for global variable 'numeric_column_in_data'

rlang, the package that helps with NSE offers a way to deal with this, by making the function code (within a package) more explicit. By refactoring to include a .data prefix, we can clear the warning:

filter_function <- function(data, filter_value) {
  data %>%
    filter(.data$numeric_column_in_data < filter_value)
  }

Please take the comments that follow, convert to an issue, then follow the contributing guidelines and create a new branch containing your changes. Commit your work, and submit a PR when ready for review.

Noted @the-mayer

@valentina-buoro
Copy link
Collaborator

  • lineage.neighbors.plot: no visible binding for global variable ‘lincount’
  • lineage_sunburst: no visible global function definition for ‘d3_nest’
  • lineage_sunburst: no visible binding for global variable ‘cpcols’
  • lineage_sunburst: no visible global function definition for ‘sund2b’
  • make_accnums_unique: no visible binding for global variable ‘accnum’
  • make_accnums_unique: no visible binding for global variable ‘suffix’
  • make_accnums_unique: no visible binding for global variable ‘accnum_adjusted’
  • make_df_iprscan_domains: no visible binding for global variable ‘Analysis’
  • make_df_iprscan_domains: no visible binding for global variable ‘AccNum’
  • make_df_iprscan_domains: no visible binding for global variable ‘StartLoc’
  • make_df_iprscan_domains: no visible binding for global variable ‘StopLoc’
  • make_df_iprscan_domains: no visible binding for global variable ‘id_domain’

Hi fellow outreachy interns. These set of functions have been worked on.

@jananiravi jananiravi added this to the Package release milestone Oct 27, 2024
@Klangina
Copy link
Contributor

Can I work on #4 (comment)

generate_fa2tre: no visible binding for global variable ‘tre_path’
generate_fa2tre: no visible binding for global variable ‘prot’
generate_fa2tre: no visible global function definition for ‘midpoint’

post the changes in #108 ?

The warning in devtools::check post the changes are as follows:

createFA2Tree: no visible global function definition for ‘midpoint’
createFA2Tree: no visible binding for global variable ‘fit_optimized2’

@the-mayer @jananiravi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers outreachy for outreachy interns package R package dev
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

5 participants