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

Update use of data("sdtm") to sdtm <- pharmaverse::sdtm in templates and vignettes #2498

Open
3 tasks
jimrothstein opened this issue Aug 24, 2024 · 10 comments · May be fixed by #2509
Open
3 tasks

Update use of data("sdtm") to sdtm <- pharmaverse::sdtm in templates and vignettes #2498

jimrothstein opened this issue Aug 24, 2024 · 10 comments · May be fixed by #2509
Assignees

Comments

@jimrothstein
Copy link
Collaborator

jimrothstein commented Aug 24, 2024

Documentation Update

Update use of data("sdtm") to sdtm <- pharmaverse::sdtm

Background Information

QUESTION about lazy loading db:

In section 7.1 of R-pkgs book (https://r-pkgs.org/data.html#sec-data-data), the use of data() is discouraged when lazy loading is used (This is case for admiral, pharamversesdtm' and others, see DESCRIPTION, LazyData: true`)

It is important to note that lazily-loaded datasets do not need to be pre-loaded with utils::data() and, in fact, it’s usually best to avoid doing so. Above, once we did library(nycflights13), we could immediately access flights. There is no call to data(flights), because it is not necessary.

Is use of data() still necessary?

Thx.

Definition of Done

  • All Vignettes have been updated to use sdtm <- pharmaverse::sdtm convention
  • All Templates have been updated to use sdtm <- pharmaverse::sdtm convention
  • Review Examples to see if any updates are needed as well if it makes sense to update (discuss once first two are completed)
@bms63
Copy link
Collaborator

bms63 commented Aug 25, 2024

@pharmaverse/admiral any thoughts?

@bundfussr
Copy link
Collaborator

Is this regarding using data() in our templates?

Technically we could remove the section with the data() calls from our templates. However, I think this would make the templates less readable because it wouldn't be clear where objects like ae or ex come from when they are used the first time. Maybe we could replace calls like data(ae) with ae <- pharmaversesdtm::ae. Then it is clear where the data comes from and the users who want to use their own data could easily replace pharmaversesdtm::ae with their source of data.

@bms63
Copy link
Collaborator

bms63 commented Aug 27, 2024

Is this regarding using data() in our templates?

Technically we could remove the section with the data() calls from our templates. However, I think this would make the templates less readable because it wouldn't be clear where objects like ae or ex come from when they are used the first time. Maybe we could replace calls like data(ae) with ae <- pharmaversesdtm::ae. Then it is clear where the data comes from and the users who want to use their own data could easily replace pharmaversesdtm::ae with their source of data.

oh man...I think we used to do this 3 years ago lol.

I like <- method more as it is better for new folks.

@bms63
Copy link
Collaborator

bms63 commented Aug 28, 2024

@jimrothstein was your concern for the vignettes? If so, I wanted to make this into an actionable issue for someone to work on this update. Probably just hijack this issue and change it up.

@jimrothstein
Copy link
Collaborator Author

jimrothstein commented Aug 28, 2024

| re: vignettes

Is this the new consensus?

Replace:
data(ae)

With:
ae <- pharmaversesdtm::ae
I am too new to have strong opinions. This is still repetetive (ae <- pharamverse::ae) but if it it brings clarity and everyone is happy, then I am fine, too.

I can make the these changes, unless you feel I should focus on data/data-raw standard, which still has much work to do.

@bms63
Copy link
Collaborator

bms63 commented Aug 28, 2024

| re: vignettes

Is this the new consensus?

Replace: data(ae)

With: ae <- pharmaversesdtm::ae I am too new to have strong opinions. This is still repetetive (ae <- pharamverse::ae) but if it it brings clarity and everyone is happy, then I am fine, too.

I can make the these changes, unless you feel I should focus on data/data-raw standard, which still has much work to do.

yes I like that more than data(ae) . All my programs have ae <- read_sas(...) in them so this looks more familiar to me.

@pharmaverse/admiral any strong objections to this update - feel like the data(ae) was adopted 2 years ago...around the merry go round we go!!

@ddsjoberg
Copy link
Collaborator

I feel like the data() convention is old-school style, meant to save bytes and bytes of RAM by not loading the data by default when a package is attached.

@StefanThoma
Copy link
Collaborator

No objections from my side either.
ae <- pharmaversesdtm::ae is more natural to me as well.

@StefanThoma
Copy link
Collaborator

This could be a good first issue

@bms63 bms63 added the good first issue Good for newcomers label Aug 29, 2024
@bms63
Copy link
Collaborator

bms63 commented Aug 29, 2024

@pharmaverse/admiral @pharmaverse/admiral_comm Quick easy one if you want to plug in!!

@bms63 bms63 changed the title Is use of data() required? Update use of data("sdtm") to sdtm <- pharmaverse::sdtm in tempaltes and vignettes Aug 30, 2024
@bms63 bms63 changed the title Update use of data("sdtm") to sdtm <- pharmaverse::sdtm in tempaltes and vignettes Update use of data("sdtm") to sdtm <- pharmaverse::sdtm in templates and vignettes Aug 30, 2024
@jeffreyad jeffreyad self-assigned this Sep 4, 2024
@jeffreyad jeffreyad linked a pull request Sep 19, 2024 that will close this issue
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

6 participants