R - TEAL on Local Machine (Error) #1086
Replies: 5 comments 8 replies
-
Can I see sessionInfo()? If it's easier, you can wait until next week when we're done releasing everything. |
Beta Was this translation helpful? Give feedback.
-
Try this:
|
Beta Was this translation helpful? Give feedback.
-
Hello,
using the following code to reproduce in locol machine but i see this
error.
[INFO] 2024-02-07 13:09:26.8288 pid:22628 token:[] teal.modules.clinical
Initializing tm_t_events
Error in choices_selected(c("ARM", "ARMCD"), "ARM") :
could not find function "choices_selected"
adsl <- tmc_ex_adsl
adae <- tmc_ex_adae
app <- teal::init(
data = cdisc_data("ADSL" = adsl,
"ADAE" = adae
),
modules = modules(
tm_t_events(
label = "Adverse Event Table",
dataname = "ADAE",
arm_var = choices_selected(c("ARM", "ARMCD"), "ARM"),
llt = choices_selected(
choices = variable_choices(adae, c("AETERM", "AEDECOD")),
selected = c("AEDECOD")
),
hlt = choices_selected(
choices = variable_choices(adae, c("AEBODSYS", "AESOC")),
selected = "AEBODSYS"
),
add_total = TRUE,
event_type = "adverse event"
)
)
)
if (interactive()) {
shinyApp(app$ui, app$server)
}
…On Tue, Feb 6, 2024 at 11:01 AM Dony Unardi ***@***.***> wrote:
Apologies, I gave the wrong URL to get the main branch of teal.
Your teal.slice version is correct.
Can you please reinstall teal again using this code:
install.packages("teal", repos = c("https://pharmaverse.r-universe.dev", getOption("repos")))
and try it out again?
—
Reply to this email directly, view it on GitHub
<#1086 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BFYKYFRLRDW2JAI7OYSA7J3YSJ4YDAVCNFSM6AAAAABCXN3YUKVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DGOBWG44DC>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
I will wait until the release. I have been having issues with running all
the example code on the local machine.. sometimes the shiny app appears and
closes immediately and some errors due to functions being deprecated . They
do run fine without any issues on the TEAL playground on posit cloud. I am
installing from main.
Thanks
…On Wed, Feb 7, 2024 at 2:30 PM Dony Unardi ***@***.***> wrote:
Can you make sure that you're installing teal.transform and tmc from main?
install.packages("teal", repos = c("https://pharmaverse.r-universe.dev", getOption("repos")))
install.packages("teal.modules.clinical", repos = c("https://pharmaverse.r-universe.dev", getOption("repos")))
Again, apologies for this, we're in the middle of the release.
—
Reply to this email directly, view it on GitHub
<#1086 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BFYKYFRVZRR2J5SG4SDBASTYSP6BRAVCNFSM6AAAAABCXN3YUKVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DIMBQG4YTC>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
Thank you. runs fine without errors, but i do see the following and the
shinyapp flashes for a sec and closes immediately., not sure why..
Listening on http://127.0.0.1:3038[INFO] 2024-02-08 07:44:58.3513
pid:27528 token:[90831486] teal Initializing
reporter_previewer_moduleWarning: Error in add_card_button_srv:
Assertion on 'names(formals(card_fun))' failed: Must be a subset of
{'card','comment'}, but has additional elements {'label'}. 3: runApp
2: print.shiny.appobj
1: <Anonymous>
…On Thu, Feb 8, 2024 at 4:42 AM André Veríssimo ***@***.***> wrote:
Apologies that you are experiencing this. Although we are keeping a
migration path for the old data APIs, the whole {teal} environment needs to
use the CRAN releases *(or development/main for those that are not yet on
CRAN)*.
As @donyunardi <https://github.com/donyunardi> said, installing all the
packages from the pharmaverse.r-universe.dev repository should allow you
to run that {teal} application and other examples without issues.
I use the following snippet to make sure that my whole teal environment is
up-to-date with development packages.
c(
"teal", "teal.data", "teal.code", "teal.slice",
"teal.logger", "teal.widgets", "teal.reporter",
"teal.transform", "teal.modules.general", "teal.modules.clinical",
"rtables", "tern"
) |> install.packages(
repos = c(
pharmaverse = "https://pharmaverse.r-universe.dev",
getOption("repos")
)
)
With this and the code snippet you shared above, I can run locally the
{teal} application *(added just 1 library call)*
All the examples imply that you are loading {teal.modules.clinical} so it
is fundamental as it will, in turn, load the choices_selected and
variable_choices from {teal.transform}.
library(teal.modules.clinical)
adsl <- tmc_ex_adsladae <- tmc_ex_adae
app <- teal::init(
data = cdisc_data("ADSL" = adsl,
"ADAE" = adae
),
modules = modules(
tm_t_events(
label = "Adverse Event Table",
dataname = "ADAE",
arm_var = choices_selected(c("ARM", "ARMCD"), "ARM"),
llt = choices_selected(
choices = variable_choices(adae, c("AETERM", "AEDECOD")),
selected = c("AEDECOD")
),
hlt = choices_selected(
choices = variable_choices(adae, c("AEBODSYS", "AESOC")),
selected = "AEBODSYS"
),
add_total = TRUE,
event_type = "adverse event"
)
)
)
if (interactive()) {
shinyApp(app$ui, app$server)
}
image.png (view on web)
<https://github.com/insightsengineering/teal/assets/211358/63130662-f32b-435b-9942-c222bf4a1591>
—
Reply to this email directly, view it on GitHub
<#1086 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BFYKYFUBNPSWPNTK7DWDOY3YSTBZ3AVCNFSM6AAAAABCXN3YUKVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DIMBXGA4DS>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
I am using the following code to test on Rstudio on my local machine, but the get the following error
library(teal)
library(shiny)
app <- init(
data = teal_data(
dataset("iris",iris),
dataset("mtcars",mtcars)
)
,
modules = list(
module(
label = "My",
ui = function(id){
tags$div("Hello")
}
)
)
)
shinyApp(app$ui,app$server)
Error:
!
to_relational_data()
was deprecated in teal.data 0.4.0 and is now defunct.ℹ Find more information on #945
Backtrace:
▆
Run rlang::last_trace(drop = FALSE) to see 1 hidden frame.
Beta Was this translation helpful? Give feedback.
All reactions