-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add new core function xportr_varnames()
#11
Conversation
…portr. Still need to add to xportr_write.
Wow! Thanks so much @AARON-CLARK! We will be looking at this soon. @elimillera |
xportr_varnames()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @AARON-CLARK, This looks really useful. I think we just need to add tm to the DESCRIPTION and the build should work here.
@elimillera or @bms63, just circling back to this PR after the new year. Since I am an out-sider, I can't run any workflows. Could one of you re-run? Thanks! |
Hey Aaron, Many thanks for working on this! Things are falling over at the moment with the tests, but I will try and investigate ASAP. @elimillera not sure if you are back from vacay, but if you have time maybe we could tag team this. In other news, it looks like xportr is being adopted into something called the pharmaverse, so we are going to be actively working on this package in the very near future. xportr will hopefully work very nicely with this https://roche-gsk.github.io/admiral/index.html package (ADaM in R Asset library) and the metacore package (https://atorus-research.github.io/metacore/ in the hopes of creating an E2E pipeline for doing Clinical Reporting in R! |
Hi @bms63, Yes, I'm very familiar with Speaking of tests, I need to follow up with another PR. I was delaying writing Thanks! |
Greetings!
Sorry for the delay in my proposed feature add, but this PR helps achieve #1. Essentially, it proposes
xportr_varnames
as a new potential core function to:(1) make sure
.df
passes all the required variable name checks, and if it doesn't...(2) automatically rename the colnames of
.df
into complianceIf you don't think adding another core function is a good approach, I also added an new argument to
xportr_write
which calledtidy_varnames
which accomplishes the same task.I tried my best to update all the documentation via the .Rd files so that developers can understand each function's purpose & process. I augmented the main "Getting Started" vignette (
xportr/docs/articles/xportr.html
) with a whole new section to showcase my vision for the function's use at a high level, so I'd start there when reviewing the code.I held off on having these new functions interface with the spec / metacore object until I got some feedback from your team. Obviously, if a user is changing a variable name in
.df
, you'd need it to match a corresponding variable in the spec/ metacore object. However, it felt... risky... changing the spec file on the fly given that's a document/ dataset that needs to be highly reviewed by peers. I did add an alternative way the user can alter the spec / metacore object directly using a second exported function calledxportr_tidy_rename
that could be used in adplyr::mutate()
and is highlighted inxportr/docs/articles/xportr.html
as well. Anyway, I'd like to hear your take and would be happy to make any changes.As a reminder, these are the variable name requirements I designed for: variable names must ...
Looking forward to your feedback! I know it's a lot to ingest. Feel free to ask questions as they come up.