Skip to content

Commit

Permalink
chore: #84 lint and style
Browse files Browse the repository at this point in the history
  • Loading branch information
bms63 committed Jun 15, 2023
1 parent 2240608 commit 0a0253e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
5 changes: 4 additions & 1 deletion vignettes/deepdive.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,10 @@ datatable(
autoWidth = TRUE
)
) %>%
formatStyle(0, target = "row", color = "black", backgroundColor = "white", fontWeight = "bold", lineHeight = "70%", textAlign = "center")
formatStyle(0,
target = "row", color = "black", backgroundColor = "white",
fontWeight = "bold", lineHeight = "70%", textAlign = "center"
)
```

## `xportr_type()`
Expand Down
34 changes: 15 additions & 19 deletions vignettes/xportr.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,18 @@ local({


```{r, include=FALSE}
knitr::knit_hooks$set(output = function(x, options){
if(!is.null(options$max_height)){
paste('<pre style = "max-height:',
options$max_height,
'; float: left; width: 775px; overflow-y: auto;">',
x, "</pre>",
sep = "")
} else{
knitr::knit_hooks$set(output = function(x, options) {
if (!is.null(options$max_height)) {
paste('<pre style = "max-height:',
options$max_height,
'; float: left; width: 775px; overflow-y: auto;">',
x, "</pre>",
sep = ""
)
} else {
x
}
})
```

# Getting Started with xportr
Expand Down Expand Up @@ -198,17 +196,16 @@ DT::datatable(adsl_order, options = list(
Now we apply formats to the dataset. These will typically be `DATE9.`, `DATETIME20` or `TIME5`, but many others can be used. Notice that in the `ADSL` dataset there are 8 Date/Time variables and they are missing formats. Here we just take a peak at a few `TRT` variables, which have a `NULL` format.

```{r, max_height = "200px", echo = FALSE}
adsl_fmt_pre <- adsl %>%
adsl_fmt_pre <- adsl %>%
select(TRTSDT, TRTEDT, TRTSDTM, TRTEDTM)
tribble(
~Variable, ~Format,
"TRTSDT", attr(adsl_fmt_pre$TRTSDT, which = "format"),
"TRTEDT", attr(adsl_fmt_pre$TRTEDT, which = "format"),
"TRTSDTM", attr(adsl_fmt_pre$TRTSDTM, which = "format"),
"TRTEDTM", attr(adsl_fmt_pre$TRTEDTM, which = "format")
)
"TRTEDTM", attr(adsl_fmt_pre$TRTEDTM, which = "format")
)
```

Using our `xportr_format()` we can apply our formats to the dataset.
Expand All @@ -218,17 +215,16 @@ adsl_fmt <- adsl %>% xportr_format(var_spec, domain = "ADSL", "message")
```

```{r, max_height = "200px", echo = FALSE}
adsl_fmt_post <- adsl_fmt %>%
adsl_fmt_post <- adsl_fmt %>%
select(TRTSDT, TRTEDT, TRTSDTM, TRTEDTM)
tribble(
~Variable, ~Format,
"TRTSDT", attr(adsl_fmt_post$TRTSDT, which = "format"),
"TRTEDT", attr(adsl_fmt_post$TRTEDT, which = "format"),
"TRTSDTM", attr(adsl_fmt_post$TRTSDTM, which = "format"),
"TRTEDTM", attr(adsl_fmt_post$TRTEDTM, which = "format")
)
"TRTEDTM", attr(adsl_fmt_post$TRTEDTM, which = "format")
)
```

# xportr_label()
Expand Down

0 comments on commit 0a0253e

Please sign in to comment.