{"id":26145763,"url":"https://github.com/rdotnet/rclr","last_synced_at":"2025-04-14T03:09:37.355Z","repository":{"id":11808304,"uuid":"14356449","full_name":"rdotnet/rClr","owner":"rdotnet","description":"R package for accessing .NET","archived":false,"fork":false,"pushed_at":"2023-08-29T20:54:43.000Z","size":1347,"stargazers_count":63,"open_issues_count":46,"forks_count":28,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-04-14T03:09:31.499Z","etag":null,"topics":["dotnet","embedded","interoperability","mono","r","r-package"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rdotnet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2013-11-13T06:54:19.000Z","updated_at":"2024-09-13T22:34:19.000Z","dependencies_parsed_at":"2022-09-23T02:20:29.130Z","dependency_job_id":"f720c17b-b819-48c7-a3ba-d40f5686cdb5","html_url":"https://github.com/rdotnet/rClr","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdotnet%2FrClr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdotnet%2FrClr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdotnet%2FrClr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdotnet%2FrClr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rdotnet","download_url":"https://codeload.github.com/rdotnet/rClr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248813795,"owners_count":21165634,"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":["dotnet","embedded","interoperability","mono","r","r-package"],"created_at":"2025-03-11T04:55:09.422Z","updated_at":"2025-04-14T03:09:37.336Z","avatar_url":"https://github.com/rdotnet.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rClr\n\n## R package for accessing .NET\n\nAccessing the Common Language Runtime (.NET or Mono) from the R statistical software, in-process.\n\n## Prerequisites\n\nAs of May 2019, on Windows Clr requires the .NET Framework (4.6.1+, 4.7.2+ recommended). Groundwork towards running on .NET Core started but it is unclear how to embed the .NET Core runtime into R.\n\nAs of September 2015 using Mono on Windows is not maintained.\n\n## Installing\n\nAs of 2019-04, releases can be found via the [release tab of the rClr GitHub repository](https://github.com/jmp75/rClr/releases).\n\n### Pre-compiled binaries\n\nYou can install pre-compiled rClr for Windows via the [release tab of the rClr GitHub repository](https://github.com/jmp75/rClr/releases). May 2019 has binary packages for R 3.4 and 3.5.\n\n`7z a rClr_windows_pkgs.7z` then `cd R_pkgs\\bin\\windows\\contrib\\3.5\\` for R 3.5.x.\n\nYou can use from the command line `R CMD INSTALL rclr_0.8.zip` where `R` points to one of the R.exe installed on your machine, or from R itself `install.packages('c:/path/to/rclr_0.8.zip')`\n\n### From source\n\nIf you want to compile from source, you may be interested in using the [testing branch](https://github.com/jmp75/rClr/tree/testing).\n\nrClr is not your average R package and requires a few more tools than is typical for most R packages.\n\n#### Windows\n\nOn Windows you will need a C# and C and/or Visual C++ compiler. Using the Visual Studio 2019 toolchain is recommended as of April 2019. Check the [visual studio download page](https://visualstudio.microsoft.com/downloads/) for options.\n\nUnder construction as of 2019-04:\n\nYou should work from the windows command prompt. I normally use and love ConEmu but for odd reasons the package install fails with `/Rtools/bin/sh: ./configure.win: No such file or directory`.\n\n```bat\nREM IMPORTANT to not have nuget.exe or other commands under c:\\bin; RTools mingw cannot find these commands\nset PATH=C:\\cmd_bin;%PATH%\nset SRC_ROOT=c:\\src\\github_jm\n\ncd %SRC_ROOT%\nrm rClr*.zip rClr*.tar.gz\n\nset PKG_VERSION=0.8.3\n```\n\nMake sure we use a recent msbuild, otherwise there may be issues with targetting .NET netstandard2.0. `.\\rClr\\src\\setup_vcpp.cmd` may help detect the most recent `msbuild.exe` you have if you have installed visual studio (unsure it works for Build Tools for Visual Studio). You can start a development prompt as a fallback if setup_vcpp fails to work on your machine.\n\n```bat\nREM https://github.com/jmp75/rClr/issues/42 may need to use VS2019\n.\\rClr\\src\\setup_vcpp.cmd\n```\n\nAfter that `where msbuild` returns e.g. `C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Professional\\MSBuild\\Current\\Bin\\MSBuild.exe`\n\nOptionally to `roxygenize` the package, launch R but from the same command prompt e.g.:\n\n```bat\nRgui.bat\n```\n\n```R\nlibrary(devtools)\ninstall_github(\"jmp75/rclr-devtools/packages/rClrDevtools\")\nlibrary(rClrDevtools) # https://github.com/jmp75/rClr-devtools\nroxyRclr('c:/src/github_jm/rClr')\n```\n\nback to windows cmd, to build the tarball:\n\n```bat\nset R_EXE=\"c:\\Program Files\\R\\R-3.5.2\\bin\\x64\\R.exe\"\nset R_VANILLA=%R_EXE% --no-save --no-restore-data\n%R_VANILLA% CMD build rClr\n```\n\n```bat\nset R_REPO_DIR=c:\\build\\software\\R_pkgs\\\n```\n\n```bat\nset R_WINBIN_REPO_DIR=%R_REPO_DIR%bin\\windows\\contrib\\3.5\\\nif not exist %R_WINBIN_REPO_DIR% mkdir %R_WINBIN_REPO_DIR%\ncd %R_WINBIN_REPO_DIR%\nrm *\n%R_VANILLA% CMD INSTALL --build %SRC_ROOT%\\rClr_%PKG_VERSION%.tar.gz\n```\n\nand to build for R 3.4:\n\n```bat\nset R_WINBIN_REPO_DIR=%R_REPO_DIR%bin\\windows\\contrib\\3.4\\\nif not exist %R_WINBIN_REPO_DIR% mkdir %R_WINBIN_REPO_DIR%\nset R_EXE=\"c:\\Program Files\\R\\R-3.4.4\\bin\\x64\\R.exe\"\nset R_VANILLA=%R_EXE% --no-save --no-restore-data\ncd %R_WINBIN_REPO_DIR%\nrm *\n%R_VANILLA% CMD INSTALL --build %SRC_ROOT%\\rClr_%PKG_VERSION%.tar.gz\n\ncd %R_REPO_DIR%..\n7z a rClr_windows_pkgs.7z R_pkgs\n```\n\n#### Linux\n\nInstalling on Linux is always installing from source anyway, be it from a tarball, cloning the repo, or using `devtools`.\n\nA Linux distribution with R, g++ and the Mono toolchain (including xbuild) should work. Note that while a range of Mono versions in the 3.X series may work, I recommend you use versions 3.8 or above. This may require you to look for adequate versions (for instance Debian is lagging behind currently). You may want to have a look at the instructions at the [mono download page for Linux](http://www.mono-project.com/download/#download-lin) and use the Xamarin packages.\n\n#### Using devtools\n\nYou should be able to install the package using the `install_github` function of the package `devtools`. The following commands have been tested successfully on Windows with VS2013 and Linux with Mono 3.10, on 2014-12-19.\n\n```R\n## Optionally you may remove a prior package\nremove.packages('rClr')\nlibrary(devtools)\ninstall_github(\"jmp75/rClr\", build_vignettes=TRUE)\n```\n\nNOTE: you must have a fully working devtools package. If devtools, on loading, reports a warning about not finding a suitable version of RTools (on Windows), this may prevent it from installing rClr. The issue has been seen for instance using devtools 1.7.0, installed from CRAN, via R 3.2.2. Package devtools 1.7.0 seems to require RTools 3.1, even when run from R 3.2.2. One way to overcome this is to install devtools from a more recent download, from its github repository.\n\n## Getting started\n\nThe package contains documentation, code sample and a vignette to get started.\n\n```S\nlibrary(rClr)\n?rClr\n## There is an HTML vignette:\nbrowseVignettes('rClr')\n```\n\nOBSOLETE: You will otherwise find some documentation at [https://r2clr.codeplex.com/documentation](https://r2clr.codeplex.com/documentation)\n\n## Feedback and contributions\n\nWhile this package is sometimes used for the author's paid day job, this is largely a personal endeavour. Support is appreciated in many forms.\n\n* Citations: As of December 2014, [A presentation given at the R user conference 2013](https://publications.csiro.au/rpr/pub?list=ASE\u0026pid=csiro:EP132284\u0026expert=false\u0026sb=RECENT\u0026n=6\u0026rpp=50\u0026page=17\u0026tr=3274\u0026dr=all\u0026csiro.affiliation=B3800). A journal paper will, hmm, \"soon\" follow.\n* Documentation: reporting issues, feature requests or discussion threads as such can be very valuable material if done well.  \n* Consulting or contract work is an option that may be arranged.\n\n## Related work\n\nA few packages using rClr are publicly accessible, and may be of interest if you want to build your own package with dependencies on rClr.\n\n* If you are interested in environmental modelling: [RtoTIME](https://github.com/jmp75/RtoTIME) is a package that depends on rClr\n* [rsqlserver](https://github.com/agstudy/rsqlserver) is an Sql Server driver database interface (DBI) driver for R\n* [A package to access optimization tools on .NET](https://github.com/jmp75/metaheuristics/tree/master/R/pkgs/mh)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frdotnet%2Frclr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frdotnet%2Frclr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frdotnet%2Frclr/lists"}