I am trying to prepare my first package for a CRAN submission and have been running devtools::check() on all recent updates.
As I was getting a lot of NOTEs about functions that had 'no visible binding for global variable 'xyz'', and this referred to notation in which I was using dplyr functions to transform data by referring to the variable names directly. So I changed all these from the dplyr::filter(species) notation to dplyr::filter(.data$species) notation.
However, then I started noticing warnings when I run these functions, saying that this method is outdated, and I should be referring to the variable names directly.
ie
'Use of .data in tidyselect expressions was deprecated in tidyselect 1.2.0.
Please use "species" instead of .data$species '
..which I now also notice suggests that I should actually be using the variable name within quotes?
Simple question: what is the best course of action that satisfies both issues?