insightsengineering / insightsengineering/teal.slice

[Bug]: The filter panel feature does not work well when data/vars have special characters

Open
#570 7 comments 0 reactions 0 assignees View on GitHub
bug core
Dominant language
R
Stars
12
Forks
7
Avg merge
3d 31m
Merged PRs (30d)
1

Description

### What happened?

The namespace creation function for the data and column names can be more robust. Right now the special characters are stripped from the name space which might not be ideal.

```r
library(teal)

app <- init(
within(teal_data(), {
iris <- iris
iris[["Species!"]] <- iris$Species
iris[["Species!@#$%^&*_-+={[()]}:;,<>./?"]] <- iris$Species
}),
modules(
example_module("Module 1"),
example_module("Module 2"),
modules(
label = "Nested modules",
example_module("Module 3"),
example_module("Module 4"),
modules(
label = "Sub nested modules",
example_module("Module 5"),
example_module("Module 6")
)
)
),
filter = teal_slices(
teal_slice(dataname = "iris", varname = "Species", multiple = FALSE),
teal_slice(dataname = "iris", varname = "Species!", multiple = TRUE),
teal_slice(dataname = "iris", varname = "Species!@#$%^&*_-+={[()]}:;,<>./?", multiple = TRUE),
teal_slice(dataname = "iris", varname = "Sepal.Length", multiple = TRUE)
)
)

shinyApp(app$ui, app$server)
```

### sessionInfo()

_No response_

### Relevant log output

_No response_

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct.

### Contribution Guidelines

- [X] I agree to follow this project's Contribution Guidelines.

### Security Policy

- [X] I agree to follow this project's Security Policy.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.