<commit_before># rserve-client

A stateful client for [Rserve](http://www.rforge.net/Rserve/), a TCP/IP server for [R project](http://www.r-project.org/).

# Example

    var r = require('rserve-client');
    r.connect('localhost', 6311, function(err, client) {
        client.eval('a<-2.7+2', function(err, ans) {
            console.log(ans);
            client.end();
        });
    });

See example directory.

# Methods

## r.connect(hostname, port, callback)

Connects to Rserve at hostname on port and returns the connection via callback.

## connection.eval(command, callback)

Evaluates the given command on Rserve and returns the result via callback.
<commit_msg>README: add npm stats badges<commit_after># rserve-client

A stateful client for [Rserve](http://www.rforge.net/Rserve/), a TCP/IP server for [R project](http://www.r-project.org/).

![npm stats](https://nodei.co/npm/rserve-client.png)

![npm download stats](https://nodei.co/npm-dl/rserve-client.png?months=9)

# Example

    var r = require('rserve-client');
    r.connect('localhost', 6311, function(err, client) {
        client.eval('a<-2.7+2', function(err, ans) {
            console.log(ans);
            client.end();
        });
    });

See example directory.

# Methods

## r.connect(hostname, port, callback)

Connects to Rserve at hostname on port and returns the connection via callback.

## connection.eval(command, callback)

Evaluates the given command on Rserve and returns the result via callback.

{'fraction_non_alphanumeric': 0.14343163538873996, 'fraction_numerical': 0.010053619302949061, 'mean_word_length': 3.378299120234604, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3326623', 'n_tokens_mistral': 489, 'n_tokens_neox': 468, 'n_words': 129}