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

Closes #12 Add PK ADaM templates #15

Merged
merged 11 commits into from
Nov 17, 2023
7 changes: 4 additions & 3 deletions adam/adpc.qmd
jeffreyad marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ adpc <- adpc_prefinal %>%

## Apply Labels and Formats with xportr

Using `{xportr}` we check variable type, assign variable lenght, add variable labels, add variable formats, and save a transport file.
Using `{xportr}` we check variable type, assign variable lenght, add variable labels, add variable formats, and save a transport file. At the end you could add a call to `xportr::xportr_write()` to produce the XPT file.

```{r}
#| label: xportr
Expand All @@ -594,6 +594,7 @@ adpc_xpt <- adpc %>%
xportr_length(metacore) %>% # Assigns SAS length from a variable level metadata
xportr_label(metacore) %>% # Assigns variable label from metacore specifications
xportr_format(metacore) %>% # Assigns variable format from metacore specifications
xportr_df_label(metacore) %>% # Assigns dataset label from metacore specifications
xportr_write("adpc.xpt") # Write xpt v5 transport file
xportr_df_label(metacore) # Assigns dataset label from metacore specifications
# xportr_write("adpc.xpt") # Write xpt v5 transport file

```
7 changes: 4 additions & 3 deletions adam/adppk.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ adppk <- adppk_prefinal %>%

## Apply Labels and Formats with xportr

Using {xportr} we check variable type, assign variable lenght, add variable labels, add variable formats, and save a transport file.
Using {xportr} we check variable type, assign variable lenght, add variable labels, add variable formats, and save a transport file with `xportr::xportr_write()`.

```{r}
#| label: xportr
Expand All @@ -538,6 +538,7 @@ adppk_xpt <- adppk %>%
xportr_length(metacore) %>% # Assigns SAS length from a variable level metadata
xportr_label(metacore) %>% # Assigns variable label from metacore specifications
xportr_format(metacore) %>% # Assigns variable format from metacore specifications
xportr_df_label(metacore) %>% # Assigns dataset label from metacore specifications
xportr_write("adppk.xpt") # Write xpt v5 transport file
xportr_df_label(metacore) # Assigns dataset label from metacore specifications
# xportr_write("adppk.xpt") # Write xpt v5 transport file

```