The code works well in R Studio Server and also from the R console, but not from the R Jupyter kernel. All of the tests were done in the same Docker container environment, so there should be no impact from e.g. software enviroment version differences.[D 2022-08-17 13:20:55.100 ServerApp] Accepting token-authenticated connection from 172.17.0.1
[D 2022-08-17 13:20:55.101 ServerApp] 200 GET /api/kernels?1660735255082 (172.17.0.1) 1.47ms
Error in as.environment(pos) :
no item called "jupyter:irkernel" on the search list
Calls: <Anonymous> ... handle_shell -> <Anonymous> -> add_to_user_searchpath -> assign
In addition: Warning message:
In sink() : no sink to remove
[D 2022-08-17 13:20:55.726 ServerApp] activity on 327c5e71-f71f-444d-897e-78c677061646: status (busy)
Execution halted
Error in detach("jupyter:irkernel") : invalid 'name' argument
Calls: <Anonymous> -> <Anonymous> -> detach
[D 2022-08-17 13:20:55.727 ServerApp] activity on 327c5e71-f71f-444d-897e-78c677061646: execute_input
[D 2022-08-17 13:20:55.769 ServerApp] 304 GET /static/favicons/favicon-busy-1.ico (172.17.0.1) 1.07ms
[D 2022-08-17 13:20:55.856 ServerApp] Accepting token-authenticated connection from 172.17.0.1
I think, I was able to pin down the problem to the apollo_initialise() function,
Code: Select all
apollo_initialise <- function()
{
doDetach <- !grepl("^(.GlobalEnv|package:|tools:|Autoloads|CheckExEnv|TempEnv)", search())
doDetach <- (search())[which(doDetach)]
if(length(doDetach)>0) for(i in 1:length(doDetach)) detach(pos=(which(doDetach[i]==search()))[1])
if(sink.number()>0) sink()
cat("Apollo ignition sequence completed\n")
}
From using the R command line,
Code: Select all
$ R
R version 4.2.1 (2022-06-23) -- "Funny-Looking Kid"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
> library("apollo")
Apollo 0.2.7
http://www.ApolloChoiceModelling.com
See url for a detailed manual, examples and a user forum.
Sign up to to user forum to receive updates on new releases.
Your version of Apollo is more than six months old.
Using the latest version will ensure you have all
current functionality and bug fixes.
You can update to the latest version by typing:
install.packages("apollo")
> doDetach <- !grepl("^(.GlobalEnv|package:|tools:|Autoloads|CheckExEnv|TempEnv)", search())
> doDetach <- (search())[which(doDetach)]
> doDetach
[1] "org:r-lib"
> search()
[1] ".GlobalEnv" "package:apollo" "package:stats"
[4] "package:graphics" "package:grDevices" "package:utils"
[7] "package:datasets" "package:methods" "Autoloads"
[10] "org:r-lib" "package:base"
Code: Select all
[1] library("apollo")
Apollo 0.2.7
http://www.ApolloChoiceModelling.com
See url for a detailed manual, examples and a user forum.
Sign up to to user forum to receive updates on new releases.
Your version of Apollo is more than six months old.
Using the latest version will ensure you have all
current functionality and bug fixes.
You can update to the latest version by typing:
install.packages("apollo")
[2] doDetach <- !grepl("^(.GlobalEnv|package:|tools:|Autoloads|CheckExEnv|TempEnv)", search())
[3] doDetach <- (search())[which(doDetach)]
[4] doDetach
'jupyter:irkernel'
[5] search()
'.GlobalEnv''package:apollo''jupyter:irkernel''package:stats''package:graphics''package:grDevices''package:utils''package:datasets''package:methods''Autoloads''package:base'
Code: Select all
$ cat /usr/local/share/jupyter/kernels/ir/kernel.json
{
"argv": ["/usr/lib/R/bin/R", "--slave", "-e", "IRkernel::main()", "--args", "{connection_file}"],
"display_name": "R",
"language": "R"
}
Code: Select all
doDetach <- !grepl("^(.GlobalEnv|package:|tools:|Autoloads|CheckExEnv|TempEnv)", search())
Code: Select all
doDetach <- !grepl("^(.GlobalEnv|package:|tools:|Autoloads|CheckExEnv|TempEnv|jupyter:irkernel)", search())