Hey Michael, there's an .Rprofile file within /home/ca_user, however it's owned by root and cannot be modified directly in the notebook unfortunately. There is a dockerfile that you can use to overwrite the file if you wish, located at /dist/scripts/Dockerfile_server_instance. You can put a new .Rprofile in the installation directory and copy it over in the Dockerfile with a COPY command. I would just make sure that the original contents of the .Rprofile file aren't erased.


These are the contents in text if you'd like to copy it:
.libPaths("/home/ca_user/r_libs")
# Create a hidden env in which to place the new functions
.env <- new.env()
# A function that imports reticulate and calls CADataConnector$read_data(...)
# The "..." parameter behaves similarly to both *args and **kwargs from Python
.env$CADataConnector$read_data <- function(...) {
ca_data_connector <- reticulate::import('ca_data_connector')
return(ca_data_connector$CADataConnector$read_data(...))
}
# A function that imports reticulate and calls CADataConnector$write_data(...)
# The "..." parameter behaves similarly to both *args and **kwargs from Python
.env$CADataConnector$write_data <- function(...) {
ca_data_connector <- reticulate::import('ca_data_connector')
ca_data_connector$CADataConnector$write_data(...)
}
# A function that imports reticulate and calls CADataConnector$search_data(...)
# The "..." parameter behaves similarly to both *args and **kwargs from Python
.env$CADataConnector$search_data <- function(...) {
ca_data_connector <- reticulate::import('ca_data_connector')
ca_data_connector$CADataConnector$search_data(...)
}
attach(.env)
------------------------------
ROBERT MCAULEY
------------------------------
Original Message:
Sent: Wed April 12, 2023 04:44 AM
From: Michael Haass
Subject: What steps are required to configure R in Cognos Juypter Notebook to use a specific repository?
Hello,
we running JNB in an air-gapped environment and need to configure JNB to use the internal repository service.
By modifying the file pip.conf of JNB installation the usage of the internal repository is possible (command !pip install <package>
works fine in JNB)
What file(s) are necessary to modify that it is also possible to just use the command install.packages("<PACKAGE_NAME>")
in R?
As far as I know there are files like Rprofile.site or .Rprofile, but such a file does not exist in the JNB installation (like pip.conf), so I assume they have to be created and put in the right place in the container.
Has anyone implemented this before?
Thanks
------------------------------
Michael
------------------------------