{"id":13711043,"url":"https://github.com/senseyeio/roger","last_synced_at":"2025-04-09T18:19:06.827Z","repository":{"id":36202142,"uuid":"40506380","full_name":"senseyeio/roger","owner":"senseyeio","description":"Golang RServe client. Use R from Go","archived":false,"fork":false,"pushed_at":"2019-10-09T21:10:45.000Z","size":86,"stargazers_count":275,"open_issues_count":7,"forks_count":33,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-04-09T18:19:02.223Z","etag":null,"topics":["data-science","go","r","rserve","scientific-computing"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/senseyeio.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}},"created_at":"2015-08-10T21:10:15.000Z","updated_at":"2025-02-04T19:25:52.000Z","dependencies_parsed_at":"2022-09-05T18:30:36.020Z","dependency_job_id":null,"html_url":"https://github.com/senseyeio/roger","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/senseyeio%2Froger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/senseyeio%2Froger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/senseyeio%2Froger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/senseyeio%2Froger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/senseyeio","download_url":"https://codeload.github.com/senseyeio/roger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248085325,"owners_count":21045139,"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":["data-science","go","r","rserve","scientific-computing"],"created_at":"2024-08-02T23:01:03.857Z","updated_at":"2025-04-09T18:19:06.804Z","avatar_url":"https://github.com/senseyeio.png","language":"Go","funding_links":[],"categories":["Repositories"],"sub_categories":[],"readme":"# Roger\n\n[![GoDoc](https://godoc.org/github.com/senseyeio/roger?status.svg)](https://godoc.org/github.com/senseyeio/roger)\n[![Build Status](https://travis-ci.org/senseyeio/roger.svg?branch=master)](https://travis-ci.org/senseyeio/roger)\n[![Join the chat at https://gitter.im/senseyeio/roger](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/senseyeio/roger?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\nRoger is a Go [RServe](http://www.rforge.net/Rserve/) client, allowing the capabilities of [R](http://www.r-project.org/) to be used from Go applications.\n\nThe communication between Go and R is via TCP. It is thread safe and supports long running R operations synchronously or asynchronously (using channels).\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/senseyeio/roger\"\n)\n\nfunc main() {\n\trClient, err := roger.NewRClient(\"127.0.0.1\", 6311)\n\tif err != nil {\n\t\tfmt.Println(\"Failed to connect\")\n\t\treturn\n\t}\n\n\tvalue, err := rClient.Eval(\"pi\")\n\tif err != nil {\n\t\tfmt.Println(\"Command failed: \" + err.Error())\n\t} else {\n\t\tfmt.Println(value) // 3.141592653589793\n\t}\n\n\thelloWorld, _ := rClient.Eval(\"as.character('Hello World')\")\n\tfmt.Println(helloWorld) // Hello World\n\n\tarrChan := rClient.Evaluate(\"Sys.sleep(5); c(1,1)\")\n\tarrResponse := \u003c-arrChan\n\tarr, _ := arrResponse.GetResultObject()\n\tfmt.Println(arr) // [1, 1]\n}\n```\n### Response Type Support\n\nRoger currently supports the following response types from R:\n\n - string and string arrays\n - booleans and boolean arrays\n - doubles and double arrays\n - ints and int arrays\n - complex and complex arrays\n - lists\n - raw byte arrays\n\nWith the use of JSON, this capability can be used to transfer any serializable object. For examples see sexp_parsing_test.go.\n\n\n### Assignment Support\n\nRoger allows variables to be defined within an R session from Go. Currently the following types are supported for variable assignment:\n\n - string and string arrays\n - byte arrays\n - doubles and double arrays\n - ints and int arrays\n\nFor examples see assignment_test.go.\n\n## Setup\nRserve should be installed and started from R:\n\n```R\ninstall.packages(\"Rserve\")\nrequire('Rserve')\nRserve()\n```\n\nMore information is available on [RServe's website](https://www.rforge.net/Rserve/doc.html).\n\nIf you would like to exploit the current R environment from go, start RServe using the following command:\n\n```R\ninstall.packages(\"Rserve\")\nrequire('Rserve')\nrun.Rserve()\n```\n\nInstall Roger using:\n\n```\ngo get github.com/senseyeio/roger\n```\n\n## Testing\nTo ensure the library functions correctly, the end to end functionality must be tested. This is achieved using [Docker](https://docs.docker.com) and [Docker Compose](https://docs.docker.com/compose). To run tests, ensure you have both Docker and Docker Compose installed, then run `docker-compose build \u0026\u0026 docker-compose up -d` from within the test directory. This command will build and start a docker container containing multiple RServe servers. These servers will be utilized when running `go test` from the project's base directory. To stop the docker container call `docker-compose stop` from the test directory.\n\n## Contributing\nIssues, pull requests and questions are welcomed. If required, assistance can be found in the project's [gitter chat room](https://gitter.im/senseyeio/roger).\n\n### Pull Requests\n\n - Fork the repository\n - Make changes\n - Ensure tests pass\n - Raise pull request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsenseyeio%2Froger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsenseyeio%2Froger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsenseyeio%2Froger/lists"}