Package

org.ddahl

rscala

Permalink

package rscala

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. rscala
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. class Debugger extends State

    Permalink
  2. trait InterpreterAdapter extends AnyRef

    Permalink
  3. class RClient extends Dynamic

    Permalink

    An interface to an R interpreter.

    An interface to an R interpreter.

    An object R is the instance of this class available in a Scala interpreter created by calling the function scalaInterpreter from the package rscala. It is through this instance R that callbacks to the original R interpreter are possible.

    In a JVM-based application, an instance of this class is created using its companion object. See below. The paths of the rscala's JARs, for both Scala 2.10 and 2.11, are available from R using rscala::rscalaJar(). To get just the JAR for Scala 2.11, for example, use rscala::rscalaJar("2.11").

    val R = org.ddahl.rscala.RClient()
    
    val a = R.evalD0("rnorm(8)")
    val b = R.evalD1("rnorm(8)")
    val c = R.evalD2("matrix(rnorm(8),nrow=4)")
    
    R eval """
      v <- rbinom(8,size=10,prob=0.4)
      m <- matrix(v,nrow=4)
    """
    val v1 = R.get("v")
    val v2 = R.get("v")._1.asInstanceOf[Array[Int]]   // This works, but is not very convenient
    val v3 = R.v._1.asInstanceOf[Array[Int]]          // Slightly better
    val v4 = R.getI0("v")   // Get the first element of R's "v" as a Int
    val v5 = R.getI1("v")   // Get R's "v" as an Array[Int]
    val v6 = R.getI2("m")   // Get R's "m" as an Array[Array[Int]]
  4. class RClient4Java extends AnyRef

    Permalink
  5. case class RObject(name: String) extends Product with Serializable

    Permalink

    A class used to wrap an arbitrary R object.

    A class used to wrap an arbitrary R object.

    val R = org.ddahl.rscala.RClient()
    R.a = Array(1,2,3,4,5)
    val ref = R.evalR("as.list(a)")
    R.evalD0(s"sum(unlist(${ref}))")
  6. class ScalaInterpreterAdapter extends InterpreterAdapter

    Permalink
  7. class ScalaServer extends AnyRef

    Permalink
  8. class State extends AnyRef

    Permalink

Value Members

  1. val Date: String

    Permalink
  2. object Helper

    Permalink
  3. object Protocol

    Permalink
  4. object RClient

    Permalink

    The companion object to the RClient class used to create an instance of the RClient class in a JVM-based application.

    The companion object to the RClient class used to create an instance of the RClient class in a JVM-based application.

    An object R is an RClient instance available in a Scala interpreter created by calling the function scalaInterpreter from the package rscala. It is through this instance R that callbacks to the original R interpreter are possible.

    The paths of the rscala's JARs, for both Scala 2.10 and 2.11, are available from R using rscala::rscalaJar(). To get just the JAR for Scala 2.11, for example, use rscala::rscalaJar("2.11").

    val R = org.ddahl.rscala.RClient()
  5. object ScalaInterpreterAdapter

    Permalink
  6. object ScalaServer

    Permalink
  7. val Version: String

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped