This plugin allows the Cheshire Cat to use tools written in R language
(and to run R code, in general)
- Just download the
cc_Rtoolsfolder intocheshire-cat/core/cat/pluginsin your machine.
Simply add to the cat's default docker-compose.yml the following code:
r-env:
build: https://github.com/dejan94it/cc_Rtools.git#main:plumber_container
container_name: r_env
expose:
- "5079:5000"
restart: unless-stoppedand obviously run docker compose up again, to add the new container to the network.
You can look at the whole docker.compose.yaml as example. You can also use it directly, but be sure that the original one is the same for the core part.
- Write a
yourscript.Rfile and put it intocc_Rtoolsfolder. - Add a @tool in
Rtools.pyusingrun_Rtool(R_url, "yourscript.R")in it.
You can look at the example of today.R tool, already present in the folder.
- You can install all the R packages you need to run your custom tools, just modifying the Dockerfile.
- You can add other endpoints (and documentation) in
plumber.Rfile.
Enjoy, and obviously, contribute! :)
Ciao Piero ❤️
