Skip to content

Commit

Permalink
Merge pull request #191 from atorus-research/81_vignette_review
Browse files Browse the repository at this point in the history
Closes #81 Review the deepdive vignette
  • Loading branch information
bms63 authored Dec 7, 2023
2 parents 7dd04d0 + b09805e commit 77322bb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
11 changes: 8 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
# xportr 0.3.1.9002
# xportr (development version)

## New Features and Bug Fixes

* `xportr_write()` now accepts `metadata` argument which can be used to set the dataset label to stay consistent with the other `xportr_*` functions. It is noteworthy that the dataset label set using the `xportr_df_label()` function will be retained during the `xportr_write()`.
* Exporting a new dataset `dataset_spec` that contains the Dataset Specification for ADSL.
* Exporting a new dataset `dataset_spec` that contains the Dataset Specification for ADSL. (#179)

## Deprecation and Breaking Changes
* The `label` argument from the `xportr_write()` function is deprecated in favor of the `metadata` argument.

* The `label` argument from the `xportr_write()` function is deprecated in favor of the `metadata` argument. (#179)

## Documentation

* Created development version of the website (#187)
* Additional guidance for options added in deep dive vignette (#81)

# xportr 0.3.1

## New Features and Bug Fixes
Expand Down
15 changes: 7 additions & 8 deletions vignettes/deepdive.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -143,20 +143,19 @@ options(
One final note on `options()`. 4 of the core `{xportr}` functions have the ability to set messaging as `"none", "message", "warn", "stop"`. Setting each of these in all your calls can be a bit repetitive. You can use `options()` to set these at a higher level and avoid this repetition.

```{r, eval = FALSE}
# Default
# Default verbose is set to `none`
options(
xportr.format_verbose = "none",
xportr.label_verbose = "none",
xportr.length_verbose = "none",
xportr.type_verbose = "none",
xportr.type_verbose = "none"
)
# Will send Warning Message to Console
options(
xportr.format_verbose = "warn",
xportr.label_verbose = "warn",
xportr.length_verbose = "warn",
xportr.type_verbose = "warn",
xportr.format_verbose = "none", # Disables any messaging, keeping the console output clean
xportr.label_verbose = "message", # Sends a standard message to the console
xportr.length_verbose = "warn", # Sends a warning message to the console
xportr.type_verbose = "stop" # Stops execution and sends an error message to the console
)
```

Expand Down Expand Up @@ -286,7 +285,7 @@ glimpse(adsl_type_glimpse)
Note that `xportr_type(verbose = "warn")` was set so the function has provided feedback, which would show up in the console, on which variables were converted as a warning message. However, you can set `verbose = "stop"` so that the types are not applied if the data does not match what is in the specification file. Using `verbose = "stop"` will instantly stop the processing of this function and not create the object. A user will need to alter the variables in their R script before using `xportr_type()`

```{r, echo = TRUE, error = TRUE}
adsl_type <- xportr_type(.df = adsl, metadata = var_spec, domain = "ADSL", verbose = "stop")
adsl_type <- xportr_type(.df = adsl_fct, metadata = var_spec, domain = "ADSL", verbose = "stop")
```

## `xportr_length()`
Expand Down

0 comments on commit 77322bb

Please sign in to comment.