Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/andy-aa/phpr

Running R code from PHP
https://github.com/andy-aa/phpr

Last synced: 2 days ago
JSON representation

Running R code from PHP

Awesome Lists containing this project

README

        

# TexLab\R
[![Build Status](https://travis-ci.com/andy-aa/phpR.svg?branch=master)](https://travis-ci.com/andy-aa/phpR)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Unstable Version](https://img.shields.io/packagist/vpre/texlab/lightdb.svg)](https://packagist.org/packages/texlab/r)
[![PHPStan](https://img.shields.io/badge/PHPStan-level%20Max-brightgreen.svg?style=flat-square)](https://phpstan.org/)
[![Psalm](https://img.shields.io/badge/Psalm-Level%20Max-brightgreen.svg?style=flat-square)](https://psalm.dev/)
[![Actions Status: CI](https://github.com/andy-aa/phpR/workflows/CI/badge.svg)](https://github.com/andy-aa/phpR/actions?query=workflow%3ACI)

## install
```
composer require texlab/r
```

### usage example
#### PHP code
```php
run($code);
```
#### output
```
Call:
lm(formula = y ~ x)

Residuals:
Min 1Q Median 3Q Max
-1.1988 -0.9164 -0.1257 0.7085 1.7562

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 4.5280 0.7291 6.211 0.000256 ***
x 1.0529 0.1175 8.961 1.91e-05 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 1.067 on 8 degrees of freedom
Multiple R-squared: 0.9094, Adjusted R-squared: 0.8981
F-statistic: 80.29 on 1 and 8 DF, p-value: 1.914e-05

```
#### PHP code
```php
run($code)

?>


Title

```
#### output
![image](https://user-images.githubusercontent.com/46691193/96785554-a1f57500-13f7-11eb-907f-b5ef36c4ec97.png)