Proto-RExp

Java library for reading and writing RProtoBuf messages

License

License

Categories

Categories

JPMML Business Logic Libraries Machine Learning
GroupId

GroupId

org.jpmml
ArtifactId

ArtifactId

proto-rexp
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

Proto-RExp
Java library for reading and writing RProtoBuf messages
Project URL

Project URL

http://www.jpmml.org

Download proto-rexp

How to add to project

<!-- https://jarcasting.com/artifacts/org.jpmml/proto-rexp/ -->
<dependency>
    <groupId>org.jpmml</groupId>
    <artifactId>proto-rexp</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.jpmml/proto-rexp/
implementation 'org.jpmml:proto-rexp:1.0.0'
// https://jarcasting.com/artifacts/org.jpmml/proto-rexp/
implementation ("org.jpmml:proto-rexp:1.0.0")
'org.jpmml:proto-rexp:jar:1.0.0'
<dependency org="org.jpmml" name="proto-rexp" rev="1.0.0">
  <artifact name="proto-rexp" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.jpmml', module='proto-rexp', version='1.0.0')
)
libraryDependencies += "org.jpmml" % "proto-rexp" % "1.0.0"
[org.jpmml/proto-rexp "1.0.0"]

Dependencies

compile (1)

Group / Artifact Type Version
com.google.protobuf : protobuf-java jar 2.6.1

Project Modules

There are no modules declared in this project.

Proto-RExp

Java library for reading and writing RProtoBuf messages

Compatibility

Installation

The current version of Proto-RExp is 1.0.0 (21 June, 2015).

The library JAR file (together with source and javadoc JAR files) is distributed via Maven Central repository:

<dependency>
	<groupId>org.jpmml</groupId>
	<artifactId>proto-rexp</artifactId>
	<version>1.0.0</version>
</dependency>

Usage

The R side of operations

Writing an RExp message:

library("RProtoBuf")

writeRExp = function(obj){
	con = file("rexp.pb", open = "wb")
	serialize_pb(obj, con)
	close(con)
}

Reading an RExp message:

library("RProtoBuf")

readRExp = function(){
	con = file("rexp.pb", open = "rb")
	obj = unserialize_pb(con)
	close(con)

	return (obj)
}

The Java side of operations

Reading an RExp message:

public RExp readRExp() throws IOException {
	InputStream is = new FileInputStream("rexp.pb");

	try {
		CodedInputStream cis = CodedInputStream.newInstance(is);

		RExp obj = RExp.parseFrom(cis);

		return obj;
	} finally {
		is.close();
	}
}

Writing an RExp message:

public void writeRExp(RExp obj) throws IOException {
	OutputStream os = new FileOutputStream("rexp.pb");

	try {
		CodedOutputStream cos = CodedOutputStream.newInstance(os);

		obj.writeTo(cos);
	} finally {
		os.close();
	}
}

License

Proto-RExp is licensed under the [BSD 3-Clause License] (http://opensource.org/licenses/BSD-3-Clause).

Additional information

Please contact [[email protected]] (mailto:[email protected])

org.jpmml

Java PMML API

Java libraries for producing and consuming PMML documents

Versions

Version
1.0.0