Skip to content

[Bug]: Code on the teal_data is omitted #276

Description

@llrs-roche

What happened?

For insightsengineering/teal.modules.clinical#1437 I found that some expressions are missed on teal:

data <- within(teal_data(), {
  ADSL <- teal.modules.clinical::tmc_ex_adsl
  ADSL$SEX[sample(seq_len(nrow(ADSL)), 50)] <- NA
})

app <- init(
  data = data,
  modules = example_module()
)
if (interactive()) {
  shinyApp(app$ui, app$server)
}

The last line is missing from the app:

Image

But it is present on the qenv.

data |> get_code() |> cat()
# ADSL <- teal.modules.clinical::tmc_ex_adsl
# ADSL$SEX[sample(seq_len(nrow(ADSL)), 50)] <- NA

A more minimal reprex is below:

data <- within(teal.code::qenv(), {
  iris <- iris
  iris$Species[sample(seq_len(nrow(iris)), 50)] <- NA
})
teal.code::get_code(data, names = "iris") |> cat()
#> iris <- iris

See diagnostics on comments below but it seems $<- and [<- is not picked by get_code

sessionInfo()

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct.

Contribution Guidelines

  • I agree to follow this project's Contribution Guidelines.

Security Policy

  • I agree to follow this project's Security Policy.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcore

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions