Skip to content

Commit

Permalink
chore: #84 stler and lintr
Browse files Browse the repository at this point in the history
  • Loading branch information
bms63 committed Jun 7, 2023
1 parent 6d004b8 commit cb115ac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
* Additional vignette showcasing functions and quality of life utilities for processing `xpts` created (#84)


## Deprecation and Breaking Changes
## Deprecation
and Breaking Changes

* The `metacore` argument has been renamed to `metadata` in the following six xportr functions: `xportr_df_label()`, `xportr_format()`, `xportr_label()`, `xportr_length()`, `xportr_order()`, and `xportr_type()`. Please update your code to use the new `metadata` argument in place of `metacore`.
# xportr 0.2.0
Expand Down
15 changes: 8 additions & 7 deletions vignettes/deepdive.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,8 @@ First, lets read in the specification file and call it `var_spec`. Note that we
```{r}
var_spec <- var_spec %>%
dplyr::rename(type = "Data Type") %>%
rlang::set_names(tolower) %>%
rlang::set_names(tolower) %>%
dplyr::mutate(order = as.numeric(order))
```

```{r, echo = FALSE}
Expand All @@ -192,7 +191,7 @@ columns2hide <- c(
datatable(
var_spec,
rownames = FALSE,
filter = 'top',
filter = "top",
options = list(
dom = "Bfrtip",
columnDefs = list(list(visible = FALSE, targets = columns2hide))
Expand Down Expand Up @@ -289,7 +288,10 @@ var_spec_lbl <- var_spec %>%
adsl_lbl <- adsl
adsl_lbl[] <- lapply(adsl_lbl, function(x) { attributes(x) <- NULL; x })
adsl_lbl[] <- lapply(adsl_lbl, function(x) {
attributes(x) <- NULL
x
})
```

We have successfully removed all the labels.
Expand Down Expand Up @@ -343,8 +345,8 @@ Formats play an important role in the SAS language and have a column in specific
This example is slightly different from previous examples. You will need to use `xportr_type()` to coerce R Date variables and others types to character or numeric. Only then can you use `xportr_format()` to apply the format column to the dataset.

```{r, echo = TRUE}
adsl_fmt <- adsl %>%
xportr_type(metadata = var_spec, domain = "ADSL", verbose = "warn") %>%
adsl_fmt <- adsl %>%
xportr_type(metadata = var_spec, domain = "ADSL", verbose = "warn") %>%
xportr_format(metadata = var_spec, domain = "ADSL", verbose = "warn")
```

Expand Down Expand Up @@ -398,7 +400,6 @@ As there at several `---DT` type variables, `xportr_write()` detects the lack of
Below we have manipulated the labels to again be greater than 40 characters for `TRTSDT`. We have turned off `xportr_label()` verbose options to only produce a message. However, the `xportr_write()` function wtih `strict_checks = TRUE` will error out as this is one of the many `xpt_validate()` checks going one behind the scenes.

```{r, echo = TRUE, error = TRUE}
var_spec_lbl <- var_spec %>%
mutate(label = if_else(variable == "TRTSDT",
"Length of variable label must be 40 characters or less", label
Expand Down

0 comments on commit cb115ac

Please sign in to comment.