{"id":20526139,"url":"https://github.com/scicloj/clojisr","last_synced_at":"2025-12-12T01:10:45.808Z","repository":{"id":43140801,"uuid":"191560749","full_name":"scicloj/clojisr","owner":"scicloj","description":"Clojure speaks statistics - a bridge between Clojure to R","archived":false,"fork":false,"pushed_at":"2024-04-25T13:29:11.000Z","size":4134,"stargazers_count":143,"open_issues_count":21,"forks_count":10,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-05-02T02:13:59.787Z","etag":null,"topics":["clojure","r","rlang"],"latest_commit_sha":null,"homepage":"https://scicloj.github.io/clojisr/","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scicloj.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-12T11:49:28.000Z","updated_at":"2024-05-07T09:55:19.096Z","dependencies_parsed_at":"2024-01-06T12:20:55.577Z","dependency_job_id":"5b51f080-91d1-458c-86ca-5b48c6b4f6d3","html_url":"https://github.com/scicloj/clojisr","commit_stats":{"total_commits":447,"total_committers":8,"mean_commits":55.875,"dds":0.2348993288590604,"last_synced_commit":"9cec56041cbb347868c666535751d3d1d25c34b6"},"previous_names":["scicloj/clojuress"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scicloj%2Fclojisr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scicloj%2Fclojisr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scicloj%2Fclojisr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scicloj%2Fclojisr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scicloj","download_url":"https://codeload.github.com/scicloj/clojisr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247406091,"owners_count":20933803,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clojure","r","rlang"],"created_at":"2024-11-15T23:12:40.906Z","updated_at":"2025-12-12T01:10:45.773Z","avatar_url":"https://github.com/scicloj.png","language":"Clojure","funding_links":[],"categories":["Clojure"],"sub_categories":["[Tools](#tools-1)"],"readme":"\n[![Clojars Project](https://img.shields.io/clojars/v/scicloj/clojisr.svg)](https://clojars.org/scicloj/clojisr)\n[![cljdoc badge](https://cljdoc.org/badge/scicloj/clojisr)](https://cljdoc.org/d/scicloj/clojisr)\n![example workflow](https://github.com/scicloj/clojisr/actions/workflows/ci.yml/badge.svg)\n# ClojisR\n\nClojure speaks statistics - a [jisr](https://en.wiktionary.org/wiki/جسر) between Clojure and R\n\n\n\n[Documentation](https://scicloj.github.io/clojisr/)\n\n## How to pronounce it?\n\nThe beginning of the pronunciation is the same as Clojure, but then it rhymes with 'kisser'. Actually, the last vowel is nonexistent, so you may try to pronounce it with less movement between s and r, like 'yesssr!'.\n\n## Status\n- still evolving\n- have been tested and used for few years\n\n## Clojurists Together\n\n**Hurray!**\n\nWe are happy to announce that `ClojisR` is selected by [Clojurists Together in Q4 2020](https://www.clojuriststogether.org/news/q4-2020-funding-announcement/)! Expect more information soon. \n\n## Scope of the project\n\nLibraries for Clojure-R interop are not new - see [this list](doc/existing_libraries.md).\n\nThis project suggests yet another way to use R from Clojure.\n\nCurrently we target only JVM Clojure, but we are interested in generalizing the work to Clojurescript.\n\nThe related problem, of calling Clojure from R, may be addressed too in the future. We are experimenting with that.\n\n## Meta Goals\n\n  * Realize what is essential for Clojure to become a beginner-friendly solution for data science.\n  \n  * Expose the Clojure ecosystem to a different culture and to more diverse groups of users/programmers.\n\n## Technical Goals\n\n  * A Function-centric API, where the default mode of usage is calling R functions on R objects, from Clojure (Status: supported)\n\n  * \"R code as Clojure data\", inspired by the EDN-based syntax inroducted in [gg4clj](https://github.com/JonyEpsilon/gg4clj) and [used](https://github.com/sbelak/huri/blob/master/src/huri/plot.clj#L299) in [huri](https://github.com/sbelak/huri) (Status: supported)\n\n  * Interop with minimal copying of data (Status: supported)\n\n  * Compatibility with common data abstractions such as [tech.ml.dataset](https://github.com/techascent/tech.ml.dataset) datasets (Status: partially supported) \n\n  * Convenient wrappers for common use cases, such as visualization (Status: basic support for plots and Rmarkdown)\n \n  * Abstraction over different runtimes (GNUR R, Renjin, FastR) (Status: GNU R is supported through Rserve; Renjin has some basic support, moved to a separate library [ClojisRenjin](missing-link))\n\n  * Convenient multi-session support (Status: basic support with some known issues)\n\n## Usage requirements\n\n* Linux, MacOS or WSL (Windows Subsystem for Linux)\n* JDK 1.8 or later\n* Clojure 1.9.0 or later\n* [R](https://www.r-project.org)\n* The [Rserve](https://cran.r-project.org/web/packages/Rserve/index.html) R package (`install.packages(\"Rserve\",,\"http://rforge.net\")`)\nTested with Rserve version 1.8.6. Earlier versions are [known](https://stackoverflow.com/questions/50410289/running-r-script-from-java-rconnection-eval-exception/50622263#50622263) to have a bug.\n* This library: [![Clojars Project](https://img.shields.io/clojars/v/scicloj/clojisr.svg)](https://clojars.org/scicloj/clojisr)\n\n### MacOS installation\n\nInstalling R with Rserve on MacOS can be problematic due to issues related to openssl installation. Please apply following steps (thanks to @ezmiller):\n\n1. Download the lastest R for mac from here: https://cloud.r-project.org/\n2. Install openssl: `brew install openssl`.\n3. Make sure that the `openssl` library is linked. Try in order:\n   * `brew link --force openssl`\n   * If that doesn't work, follow directions in `brew info openssl` for setting environment variables. Set the `LIBRARY_PATH` environment variable to the location of the library, e.g. `export LIBRARY_PATH=/usr/local/opt/openssl@1.1/lib`.\n\n### Setting up the logging\n\n* `clojisr` library uses [clojure/tools.logging](https://github.com/clojure/tools.logging) for logging. `tools.logging` doesn't force any logging backend and users have to configure it on their side. To force specific backend you can set it using JVM options, for example in lein `profile.clj` or `project.clj`:\n\n```clj\n:jvm-opts [\"-Dclojure.tools.logging.factory=clojure.tools.logging.impl/jul-factory\"]\n```\n\n### Docker image\n\n\n\nThanks to Carsten Behring we have a Docker template prepared\n\nhttps://github.com/behrica/clj-py-r-template\n\nThe Dockerfile of the template adds as well python + libpython-clj for completeness.\n\nSo it has in a single place all dependencies and they do work together and no further setup is required.\n\n### devcontainer \nThe scicloj community is maintaining a `devcontainer` [template](https://github.com/scicloj/devcontainer-templates/tree/main/src/scicloj) on which `clojisr` is known to work out of the box.\n\n## Checking if it works\n\nThis should work for you (assuming you have the [clj tool](https://clojure.org/guides/getting_started)):\n\n```clj\n$ clj -Sdeps '{:deps {scicloj/clojisr {:mvn/version \"1.0.0-BETA20\"}}}'\nClojure 1.10.1\nuser=\u003e (require '[clojisr.v1.r :refer [r]])\n\nuser=\u003e (r '(+ 1 2))\n[1] 3\n```\n\n## Known issues\n\n* clojisr can behave in a strange way when abandoned R (with Rserve) processes are running. Please kill such processes before creating an Rserve session.\n* Nextjournal can hang due to problems with logging, please add ` org.slf4j/slf4j-nop {:mvn/version \"1.7.30\"}` to the deps to disable logger.\n\n## Video presentations\n\nThe main ideas were discussed at [Scicloj Web meeting #7](https://www.youtube.com/watch?v=XoVX2Ezi_YM) and [ClojuTRE 2019](https://www.youtube.com/watch?v=A55jO02ZKcg).\n\nNote however that:\n- The API has changed since then (code generation mechanism, data visualization support, printing - see the [Tutorials](#Tutorials) below).\n- On the meeting, there is some careless use of the term 'zero copy'. Actually, what is usually meant by this term is not supported at the moment.\n\n## Tutorials\n\n* The tutorials are now organized in [a book](https://scicloj.github.io/clojisr).\n\n* More examples -- see the [clojisr-examples repo](https://github.com/scicloj/clojisr-examples#list-of-examples)\n\n## Background\n\n1. [Lisp for statistical computing](doc/lisp_for_stats.md)\n\n2. [Calling R from Clojure: existing libraries](doc/existing_libraries.md)\n\n3. [R backends](doc/r_backends.md)\n\n4. [Some of R's data abstractions](doc/r_data_abstractions.md)\n\n5. [Clojure's counterparts of R's data abstractions](doc/clojure_counterparts.md)\n\n## Choices of the current project\n\n[Here](doc/choices.md) are the current priorities of the project in some central design and implementation questions.\n\n\n## Future opportunities\n\n[Here](doc/future.md) are some possible future developments we are considering.\n\n\n## Discussion\n\nPlease share your comments, thoughts, ideas and questions at the [Issues Page](https://github.com/scicloj/clojisr/issues) of this project and at the [r-interop stream](https://clojurians.zulipchat.com/#narrow/stream/204621-r-interop) of the Clojurians Zulip.\n\nAlso we run [a stream](https://clojurians.zulipchat.com/#narrow/stream/224816-clojisr-dev) for developers or people interested in contributing.\n\n## Testing\n\nThe tests are regular clojure.test tests, but are auto-genedated from the tutorials.\n\n## Tools used\n\nWorking on this project, we enjoyed the following tools (partial list):\n\n* In early versions, [hara.test](https://cljdoc.org/d/hara/test/3.0.7) was used for automated docstrings by tests. We may come back to using it.\n\n* [clj-kondo](https://github.com/borkdude/clj-kondo) for code quality control\n\n* [Clay](https://scicloj.github.io/clay/) for documentation and test generation\n\n## License\n\nCopyright © 2019-2020 Scicloj \n\nThis program and the accompanying materials are made available under the\nterms of the Eclipse Public License 2.0 which is available at\nhttp://www.eclipse.org/legal/epl-2.0.\n\nThis Source Code may also be made available under the following Secondary\nLicenses when the conditions for such availability set forth in the Eclipse\nPublic License, v. 2.0 are satisfied: GNU General Public License as published by\nthe Free Software Foundation, either version 2 of the License, or (at your\noption) any later version, with the GNU Classpath Exception which is available\nat https://www.gnu.org/software/classpath/license.html.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscicloj%2Fclojisr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscicloj%2Fclojisr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscicloj%2Fclojisr/lists"}