Skip to content

Commit

Permalink
update my_plot code
Browse files Browse the repository at this point in the history
  • Loading branch information
donyunardi committed Nov 6, 2024
1 parent c62378f commit c508c13
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion vignettes/creating-custom-modules.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ However, it is also possible to create your own modules using the `module` funct

In this guide, we will use the simple histogram below as an example, and demonstrate how to convert this histogram function into a robust `teal` module step-by-step:
```r
hist(dataset[, selected], las = 1)
my_plot <- hist(
dataset[[vars]],
las = 1,
main = paste("Histogram of", vars),
xlab = vars,
col = "lightblue",
border = "black"
)
```
This module will allow users to dynamically select datasets and variables to create histograms within a `teal` application.
We will cover best practices, including setting up dynamic inputs, structuring server logic, and using the `teal_data` object to ensure reactivity and reproducibility.
Expand Down

0 comments on commit c508c13

Please sign in to comment.