Skip to content

Commit

Permalink
docs: #84 adjusted type discussion
Browse files Browse the repository at this point in the history
  • Loading branch information
bms63 committed Jun 15, 2023
1 parent ebea401 commit 67b6925
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vignettes/deepdive.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ datatable(

## `xportr_type()`

We are going to explore the type column in the metadata object. A submission to a Health Authority should only have character and numeric types in the data. In the `ADSL` data we have several columns that are in the Date type: `TRTSDT`, `TRTEDT`, `DISONSDT`, `VISIT1DT` and `RFENDT`. We will change one variable type to a [factor variable](https://forcats.tidyverse.org/), which is a common data structure in R, to give us some educational opportunities.
We are going to explore the type column in the metadata object. A submission to a Health Authority should only have character and numeric types in the data. In the `ADSL` data we have several columns that are in the Date type: `TRTSDT`, `TRTEDT`, `DISONSDT`, `VISIT1DT` and `RFENDT` - under the hood these are actually numeric values and will be left as is. We will change one variable type to a [factor variable](https://forcats.tidyverse.org/), which is a common data structure in R, to give us some educational opportunities to see `xportr_type()` in action.

```{r}
adsl_fct <- adsl %>%
Expand All @@ -270,7 +270,7 @@ adsl_type_glimpse <- adsl_type %>%
select(STUDYID, TRTSDT, TRTEDT, DISONSDT, VISIT1DT, RFENDT)
```

Success! As we can see below, `xportr_type()` applied the types from the metadata object to the below columns converting them all to the proper type. The functions in `{xportr}` also display this coercion to the user in the console, which is seen above.
Success! As we can see below, `xportr_type()` applied the types from the metadata object to the `STUDYID` variables converting to the proper type. The functions in `{xportr}` also display this coercion to the user in the console, which is seen above.

```{r, echo = TRUE}
glimpse(adsl_type_glimpse)
Expand Down

0 comments on commit 67b6925

Please sign in to comment.