Documentation ¶
Overview ¶
Package rgo provides a mechanism to call into R. This package assumes that you have the R binary in your PATH and that you have the jsonlite and RCurl R packages installed.
Why make rgo?
R has many useful plotting and statistics libraries. rgo is a simple libary that gives you access to these from Go. This way, you can transform and process your data in Go, and use R's plotting/statistics libraries to generate your final figures. As a result, this package is not designed to be high-performance or have minimal memory consumption. Transferring data between Go and R requires making several copies of the data, and memory will not be freed in R. Nevertheless, this package should be sufficient for basic R usage.
Index ¶
- func IsError(e error) bool
- func IsWarning(e error) bool
- type Conn
- func (c *Conn) Close() error
- func (c *Conn) Error() error
- func (c *Conn) Get(data interface{}, name string) error
- func (c *Conn) R(cmd string) error
- func (c *Conn) Rf(format string, args ...interface{}) error
- func (c *Conn) Send(data interface{}, name string) error
- func (c *Conn) SendDF(df dataframe.DataFrame, name string) error
- func (c *Conn) Strict() error
- type ConnOption
- type DependencyError
- type RError
- type RWarning
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn is used to start and communicate with an R process. Conn is NOT thread-safe. However, you may run multiple Conn's in the same process safely. It is safe to run successive operations on Conn successively and retrieve any errors using Error(). Do not that although R warnings will be returned in method calls, they will not be captured in Error().
Objects in R will not be freed until the Conn is closed.
func Connection ¶
func Connection(opts ...ConnOption) (*Conn, error)
Connections creates a *Conn which can be used to run R commands.
func (*Conn) Error ¶
Error returns the first error that occured in the sequence of operations. R warnings are ignored.
func (*Conn) R ¶
R sends a command to R. An Error or Warning generated by the command will be returned as an RError or RWarning.
type DependencyError ¶
Directories ¶
Path | Synopsis |
---|---|
Package dataframe provides a R-like data frame type that can be easily transferred into R using the rgo package.
|
Package dataframe provides a R-like data frame type that can be easily transferred into R using the rgo package. |
This package provides utility functions for interacting with R. This package is highly experimental and the functionality will eventually be split into more appropriate packages (e.g.
|
This package provides utility functions for interacting with R. This package is highly experimental and the functionality will eventually be split into more appropriate packages (e.g. |