You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
joethorley
changed the title
Create function to generate code to select exactly the columns in a data frame.
Create selecting() to generate code to select exactly the columns in a data frame.
Dec 21, 2022
have a type = argument that defaults to "all" but also has the options of "drop_uninformative" and "keep_uninformative" as they align with naming and utility we already have in the package?
have a regex = argument so you can pass regular expressions
the function would first select the columns based on the type argument and then could subset them down further using the regex argument
the .fix = argument applies formatting to the column names it outputs so they either come out without any things around them or with a " around them, or backticks `, or even append a prefix or suffix to them
I don' think necessary for the drop uninformative and keep uninformative as could just do this at the start before calling selecting(). May be better to call function selected() as its really just describing what has been selected at this point.
Note however I think that drop_uninformative_colums() and keep_uninformative_colums() should write the equivalent selected() call to the console unless the user silences.
I also think that the regex argument is unnecessary as the user could just call select(matches(x)) before calling selected().
What we are looking for is code that can be embeded in the script to select exactly the columns that were in the data frame at the time that selected() was called so whether or not column names are backticked should just be determined by whether this is necessary I think?
a great way to say only select informative columns and the convert to code that no longer depends on values (to avoid breakage)
The text was updated successfully, but these errors were encountered: