Skip to content

Commit

Permalink
#12 add tempdir
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyad committed Nov 6, 2023
1 parent 707b466 commit 9db29eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions adam/adpc.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -589,12 +589,14 @@ Using `{xportr}` we check variable type, assign variable lenght, add variable la
```{r}
#| label: xportr
#| warning: false
dir <- tempdir() # Change to whichever directory you want to save the dataset in
adpc_xpt <- adpc %>%
xportr_type(metacore) %>% # Coerce variable type to match spec
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(file.path(dir, "adpc.xpt")) # Write xpt v5 transport file
```
5 changes: 3 additions & 2 deletions adam/adppk.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -532,13 +532,14 @@ Using {xportr} we check variable type, assign variable lenght, add variable labe

```{r}
#| label: xportr
dir <- tempdir() # Change to whichever directory you want to save the dataset in
adppk_xpt <- adppk %>%
xportr_type(metacore) %>% # Coerce variable type to match spec
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(file.path(dir, "adppk.xpt")) # Write xpt v5 transport file
```

0 comments on commit 9db29eb

Please sign in to comment.