Skip to content

Commit ee745cf

Browse files
authored
Merge branch 'main' into 143_navitas_R_blog
2 parents c1cc0ae + b9a3ff3 commit ee745cf

File tree

3 files changed

+21
-11
lines changed

3 files changed

+21
-11
lines changed

.github/workflows/publish.yml

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
metatools
4141
xportr
4242
pharmaverseadam
43+
link
4344
4445
4546
- name: Install tinytex

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ Most importantly:
8383

8484
**Step 7:** Have fun :)
8585

86+
## Tips and Tricks
87+
88+
* You can use the [link](https://cran.r-project.org/web//packages//link/index.html) package to create dynamic links for a function to its package down website in a blog post. For example,
89+
instead of doing function_name with markdown syntax for url linking, i.e [link](https://cran.r-project.org/web//packages//link/index.html), you can just do `admiral::derive_vars_dy()`
90+
and it will create the link in your blog post. See the raw code in this post [admiral 1.0.0](https://pharmaverse.github.io/blog/posts/2023-12-18_admiral_1_0/admiral_1_0.html) to see
91+
it in action.
92+
8693
## How to Use the `blog` Docker Image for Local Development
8794

8895
Contributors can benefit from using the [`blog` Docker image](https://github.com/pharmaverse/blog/pkgs/container/blog) when creating their blog posts.

posts/2023-12-18_admiral_1_0/admiral_1_0.qmd

+13-11
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ image: "new_features.jpg"
1515
<!--------------- typical setup ----------------->
1616

1717
```{r setup, include=FALSE}
18+
library(link)
1819
long_slug <- "2023-12-18_admiral_1_0"
1920
# renv::use(lockfile = "renv.lock")
21+
link::auto(keep_pkg_prefix = FALSE)
2022
```
2123

2224
<!--------------- post begins here ----------------->
@@ -29,7 +31,7 @@ This blog post will discuss our commitment to stability, walk you through the ne
2931

3032
# Commitment to Stability
3133

32-
`{admiral}` was born out of a conversation between Thomas Neitmann and Michael Rimler almost three years ago. Check out this [history blog post](https://pharmaverse.github.io/blog/posts/2023-10-10_pharmaverse_story/pharmaverse_story.html) for some of additional context on its development. Over the last three years, we have worked at a furious pace to produce functions that can do almost all derivations needed for common ADaMs. However, we have noticed that some functions are very similar to others and with some minor tweaks could be made redundant in favor of other functions. This has lead to some deprecation of either whole functions or arguments as we have sought to consolidate. Unfortunately, this creates a lot of frustration for users.
34+
{admiral} was born out of a conversation between Thomas Neitmann and Michael Rimler almost three years ago. Check out this [history blog post](https://pharmaverse.github.io/blog/posts/2023-10-10_pharmaverse_story/pharmaverse_story.html) for some of additional context on its development. Over the last three years, we have worked at a furious pace to produce functions that can do almost all derivations needed for common ADaMs. However, we have noticed that some functions are very similar to others and with some minor tweaks could be made redundant in favor of other functions. This has lead to some deprecation of either whole functions or arguments as we have sought to consolidate. Unfortunately, this creates a lot of frustration for users.
3335

3436
Enter Superseded!!
3537

@@ -40,18 +42,18 @@ Now with the release of `1.0.0` we are going to _supersede_ functions going forw
4042

4143
We have 3 new functions available in this release:
4244

43-
* [derive_vars_extreme_event()](https://pharmaverse.github.io/admiral/reference/derive_vars_extreme_event.html)
44-
* [derive_var_merged_ef_msrc()](https://pharmaverse.github.io/admiral/reference/derive_var_merged_ef_msrc.html)
45-
* [derive_vars_computed()](https://pharmaverse.github.io/admiral/reference/derive_vars_computed.html)
45+
* admiral::derive_vars_extreme_event()
46+
* admiral::derive_var_merged_ef_msrc()
47+
* admiral::derive_vars_computed()
4648

47-
and a new option in [derive_var_atoxgr_dir()](https://pharmaverse.github.io/admiral/reference/derive_var_atoxgr_dir.html) and [derive_var_anrind()](https://pharmaverse.github.io/admiral/reference/derive_var_anrind.html) to handle floating point issues.
49+
and a new option in admiral::derive_var_atoxgr_dir() and admiral::derive_var_anrind() to handle floating point issues.
4850

4951
## `derive_vars_extreme_event()`
5052

51-
This function takes available records from user-defined events by selecting the extreme observations and appending them as a variable(s) to your dataset. [derive_vars_extreme_event()](https://pharmaverse.github.io/admiral/reference/derive_vars_extreme_event.html) works similar to [`derive_extreme_event()`](https://pharmaverse.github.io/admiral/reference/derive_extreme_event.html), but instead of adding observations the function will add variable(s).
53+
This function takes available records from user-defined events by selecting the extreme observations and appending them as a variable(s) to your dataset. admiral::derive_vars_extreme_event() works similar to admiral::derive_extreme_event(), but instead of adding observations the function will add variable(s).
5254

5355
Let's take a peek with a very simple example where we just use ADSL! The documentation for
54-
[derive_vars_extreme_event()](https://pharmaverse.github.io/admiral/reference/derive_vars_extreme_event.html) has a much richer example with events from other domains that is more aligned to where you would use this function.
56+
admiral::derive_vars_extreme_event() has a much richer example with events from other domains that is more aligned to where you would use this function.
5557

5658
Let us make some dummy `ADSL` data and load up our packages. The goal here is to add two new variables `LSTALVDT` and `DTHFL` based on a list of objects that are used to specify the following:
5759

@@ -107,7 +109,7 @@ out the more detailed example in the [function documentation](https://pharmavers
107109

108110
## `derive_var_merged_ef_msrc()`
109111

110-
This function has some similarity to [derive_vars_extreme_event()](https://pharmaverse.github.io/admiral/reference/derive_vars_extreme_event.html), but now we are only looking at adding a single flag variable based on checking conditions across multiple datasets.
112+
This function has some similarity to admiral::derive_vars_extreme_event(), but now we are only looking at adding a single flag variable based on checking conditions across multiple datasets.
111113

112114
We develop some _simple_ dummy data for `ADSL`, `CM` and `PR`. Our goal is to flag patients who have `CMCAT = "ANTI-CANCER"` in the `CM` dataset or have records in the `PR` dataset. Any participants who meet these conditions will have our new variable `CANCTRFL` set as `"Y"`.
113115

@@ -160,7 +162,7 @@ Let's go! We searched over multiple datasets, `CM` and `PR`, with multiple condi
160162

161163
## `derive_vars_computed()`
162164

163-
This function is very similar to [derive_param_computed()](https://pharmaverse.github.io/admiral/reference/derive_param_computed.html), but instead of adding observations we are going to add variable(s). Very handy when wanting to add some additional variables to `ADSL`, e.g. baseline variables.
165+
This function is very similar to admiral::derive_param_computed(), but instead of adding observations we are going to add variable(s). Very handy when wanting to add some additional variables to `ADSL`, e.g. baseline variables.
164166

165167
Let's make some dummy data for an `ADSL` and `ADVS`. Our goal is to derive a `BMIBL` variable pulled from `ADVS` and append to `ADSL`.
166168

@@ -211,7 +213,7 @@ Alright! Simple enough. We just took records from `ADVS`to help us calculate the
211213

212214
A huge push was made for `1.0.0` to help align our arguments across all of `{admiral}` functions. What does this mean? We identified arguments in functions where the argument did the same things but was slightly named differently. For `1.0.0`, we really want users to have a solid API for `{admiral}` functions.
213215

214-
Let's take a peak at the function [`consolidate_metadata()`](https://pharmaverse.github.io/admiral/reference/consolidate_metadata.html) to even better understand our goal here.
216+
Let's take a peak at the function admiral::consolidate_metadata() to even better understand our goal here.
215217

216218
```
217219
consolidate_metadata(
@@ -224,7 +226,7 @@ consolidate_metadata(
224226
)
225227
```
226228

227-
In previous versions of `{admiral}` the `consolidate_metadata()` function had the argument `check_keys`, which helps to check uniqueness. Other functions had a similar argument, but were called `check_unique`. Therefore, to better align our common API for `{admiral}` functions we decided to rename the `check_keys` argument to `check_unique`. You can follow the discussion around this renaming effort in this [GitHub Issue](https://github.com/pharmaverse/admiral/issues/2184).
229+
In previous versions of {admiral} the admiral::consolidate_metadata() function had the argument `check_keys`, which helps to check uniqueness. Other functions had a similar argument, but were called `check_unique`. Therefore, to better align our common API for {admiral} functions we decided to rename the `check_keys` argument to `check_unique`. You can follow the discussion around this renaming effort in this [GitHub Issue](https://github.com/pharmaverse/admiral/issues/2184).
228230

229231
```{r, fig.align = 'center', echo=FALSE}
230232
knitr::include_graphics("check.png")

0 commit comments

Comments
 (0)