arrgh
arrgh: a Go interface to the OpenCPU R server system - Published in JOSS (2018)
Science Score: 95.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 6 DOI reference(s) in README and JOSS metadata -
✓Academic publication links
Links to: joss.theoj.org -
✓Committers with academic emails
1 of 1 committers (100.0%) from academic institutions -
○Institutional organization owner
-
✓JOSS paper metadata
Published in Journal of Open Source Software
Repository
Go interface to the OpenCPU R server system
Basic Info
Statistics
- Stars: 13
- Watchers: 3
- Forks: 1
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
arrgh (Pronunciation: /ɑː/ or /är/) is an interface to the OpenCPU R server system.
Overview
The arrgh package provides API interfaces to remote or local OpenCPU R servers.
Go is a well established network systems language and has seen increasing use in data science and other fields of scientific software development. The arrgh package allows developers to leverage the rich statistical analysis environment available through R that is lacking in the Go ecosystem.
Example
``` package main
import ( "bufio" "encoding/json" "fmt" "io" "log" "net/url" "os" "path" "path/filepath" "strings" "time"
"github.com/kortschak/arrgh"
)
func main() { r, err := arrgh.NewRemoteSession("http://public.opencpu.org", "", 10*time.Second) if err != nil { log.Fatal(err) } defer r.Close()
// Send a query to get a session result for the linear
// regression: coef(lm(speed~dist, data=cars)).
resp, err := r.Post(
"library/base/R/identity",
"application/x-www-form-urlencoded",
nil,
strings.NewReader("x="+url.QueryEscape("coef(lm(speed ~ dist, data = cars))")),
)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
// Get each part of the session result and display it,
// keeping the location of the linear regression.
sc := bufio.NewScanner(resp.Body)
var val string
for sc.Scan() {
// API root path stripping here depends on consistency
// between os.Separator and the URL path separator.
p, err := filepath.Rel(r.Root(), sc.Text())
if err != nil {
log.Fatal(err)
}
if path.Base(p) == ".val" {
val = p
}
fmt.Printf("%s:\n", p)
resp, err := r.Get(p, nil)
if err != nil {
log.Fatal(err)
}
io.Copy(os.Stdout, resp.Body)
fmt.Print("\n\n")
resp.Body.Close()
}
// Get the linear regression result as JSON.
res, err := r.Get(path.Join(val, "json"), url.Values{"digits": []string{"10"}})
if err != nil {
log.Fatal(err)
}
defer res.Body.Close()
// Decode the result into a [2]float64.
var lm [2]float64
dec := json.NewDecoder(res.Body)
err = dec.Decode(&lm)
if err != nil {
log.Fatal(err)
}
fmt.Printf("lm: intercept=%f dist=%f\n", lm[0], lm[1])
} ```
Output:
```
tmp/x0113a3ca85/R/identity:
function (x)
x
tmp/x0113a3ca85/R/.val: (Intercept) dist 8.2839056 0.1655676
tmp/x0113a3ca85/stdout: (Intercept) dist 8.2839056 0.1655676
tmp/x0113a3ca85/source: identity(x = coef(lm(speed ~ dist, data = cars)))
tmp/x0113a3ca85/console:
identity(x = coef(lm(speed ~ dist, data = cars))) (Intercept) dist 8.2839056 0.1655676
tmp/x0113a3ca85/info: R version 3.4.1 (2017-06-30) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 16.04.2 LTS
Matrix products: default BLAS: /usr/lib/openblas-base/libblas.so.3 LAPACK: /usr/lib/libopenblasp-r0.2.18.so
locale:
[1] LCCTYPE=enUS.UTF-8 LCNUMERIC=C LCTIME=enUS.UTF-8
[4] LCCOLLATE=enUS.UTF-8 LCMONETARY=enUS.UTF-8 LCMESSAGES=C
[7] LCPAPER=C LCNAME=C LCADDRESS=C
[10] LCTELEPHONE=C LCMEASUREMENT=C LCIDENTIFICATION=C
attached base packages: [1] stats graphics grDevices utils datasets methods base
other attached packages: [1] opencpu_2.0.3.1
loaded via a namespace (and not attached):
[1] Rcpp0.12.11 lattice0.20-35 mime0.5 plyr1.8.4
[5] grid3.4.1 gtable0.2.0 sys1.4 jsonlite1.5
[9] unix1.3 magrittr1.5 scales0.4.1 evaluate0.10.2
[13] ggplot22.2.1 rlang0.1.1 stringi1.1.5 curl2.7
[17] lazyeval0.2.0 webutils0.6 tools3.4.1 stringr1.2.0
[21] munsell0.4.3 parallel3.4.1 sendmailR1.2-1 compiler3.4.1
[25] colorspace1.3-2 base64enc0.1-3 openssl0.9.6 tibble1.3.3
tmp/x0113a3ca85/files/DESCRIPTION: Package: x0113a3ca85 Type: Session Version: 2.0.3.1 Author: OpenCPU Date: 2017-07-07 Description: This file is automatically generated by OpenCPU.
lm: intercept=8.283906 dist=0.165568 ```
Installation
arrgh requires a Go installation, and if using a local R instance OpenCPU (tested on v1.6 and v2.0) and semver must be installed as R packages.
go get github.com/kortschak/arrgh
See the OpenCPU CRAN page for a complete description of OpenCPU R and system dependencies and this page for instructions for installing OpenCPU from source.
Documentation
http://godoc.org/github.com/kortschak/arrgh
Getting help
Help or similar requests can be asked on the bug tracker, or for more general OpenCPU questions at the OpenCPU google groups.
https://groups.google.com/forum/#!forum/opencpu
Contributing
If you find any bugs, feel free to file an issue on the github issue tracker. Pull requests are welcome.
Citing
If you use the arrgh package, please cite:
Kortschak, R Daniel (2018). arrgh: a Go interface to the OpenCPU R server system. Journal of Open Source Software, 3(21), 517, https://doi.org/10.21105/joss.00517
License
arrgh is distributed under a modified BSD license.
Owner
- Name: Dan Kortschak
- Login: kortschak
- Kind: user
- Location: Adelaide, South Australia
- Website: https://kortschak.io/
- Repositories: 211
- Profile: https://github.com/kortschak
Actually Doing Science
JOSS Publication
arrgh: a Go interface to the OpenCPU R server system
Tags
statistics R golangCodeMeta (codemeta.json)
{
"@context": "https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld",
"@type": "Code",
"author": [
{
"@id": "https://orcid.org/0000-0001-8295-2301",
"@type": "Person",
"email": "dan.kortschak@adelaide.edu.au",
"name": "R Daniel Kortschak",
"affiliation": "School of Biological Sciences, The University of Adelaide"
}
],
"identifier": "",
"codeRepository": "https://github.com/kortschak/arrgh",
"datePublished": "2017-07-07",
"dateModified": "2017-07-07",
"dateCreated": "2017-07-07",
"description": "Go interface to the OpenCPU R server system",
"keywords": "Go, R, OpenCPU",
"license": "BSD",
"title": "arrgh",
"version": "v1.0.1"
}
GitHub Events
Total
Last Year
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| kortschak | d****k@a****u | 45 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 3
- Total pull requests: 18
- Average time to close issues: 1 day
- Average time to close pull requests: 2 days
- Total issue authors: 2
- Total pull request authors: 1
- Average comments per issue: 2.67
- Average comments per pull request: 0.22
- Merged pull requests: 18
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- brentp (2)
- fjukstad (1)
Pull Request Authors
- kortschak (18)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
- Total downloads: unknown
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 2
proxy.golang.org: github.com/kortschak/arrgh
Package arrgh provides an interface to R via an OpenCPU server. Interaction with the OpenCPU system is via the OpenCPU API https://www.opencpu.org/api.html. Data serialisation and deserialisation at the R end is performed by jsonlite, see http://cran.r-project.org/web/packages/jsonlite/jsonlite.pdf for the jsonlite manual.
- Homepage: https://github.com/kortschak/arrgh
- Documentation: https://pkg.go.dev/github.com/kortschak/arrgh#section-documentation
- License: BSD-3-Clause
-
Latest release: v1.0.1
published about 8 years ago
