Macaulay2 » Documentation
Packages » RInterface :: RInterface
next | previous | forward | backward | up | index | toc

RInterface -- interface to R for statistical computing

Description

This package allows for the ability to interface with R for statistical computing inside Macaulay2.

i1 : dataFrame = RFunction "data.frame"

o1 = dataFrame

o1 : RFunction
i2 : chisqTest = RFunction "chisq.test"

o2 = chisqTest

o2 : RFunction
i3 : M = dataFrame(F => {762, 327, 468}, M => {484, 239, 477},
         "row.names" => {"Democrat", "Independent", "Republican"})

o3 =               F   M
     Democrat    762 484
     Independent 327 239
     Republican  468 477

o3 : RObject of type list
i4 : chisqTest M

o4 = 
             Pearson's Chi-squared test

     data:  structure(list(F = c(762L, 327L, 468L), M = c(484L, 239L, 477L)), class = "data.frame", row.names = c("Democrat", "Independent", "Republican"))
     X-squared = 30.07, df = 2, p-value = 2.954e-07


o4 : RObject of type list
i5 : value oo_"p.value"

o5 = 2.95358918321176e-7

o5 : RR (of precision 53)

Author

Version

This documentation describes version 0.1 of RInterface.

Source code

The source code from which this documentation is derived is in the file RInterface.m2. The auxiliary files accompanying it are in the directory RInterface/.

Exports

For the programmer

The object RInterface is a package.