Skip to content

jsams/RData.jl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RData.jl

Julia 0.6 Status

Coverage Status Build Status Build status

Read R data files (.rda, .RData) and optionally convert the contents into Julia equivalents.

Can read any R data archive, although not all R types could be converted into Julia.

For running R code from Julia see RCall.jl.

Installation

From Julia REPL:

Pkg.add("RData")

Usage

To read R objects from "example.rda" file:

using RData

objs = load("path_to/example.rda")

The result is a dictionary (Dict{String, Any}) of all R objects stored in "example.rda".

If convert=true keyword option is specified, load() will try to automatically convert R objects into Julia equivalents:

R object Julia object
named vector, list DictoVec DictoVec allows indexing both by element index and by its name, just as R vectors and lists
vector Vector{T} T is the appropriate Julia type. If R vector contains NA values, they are converted to missing, and the elements type of the resulting Vector is Union{T, Missing}.
factor CategoricalArray CategoricalArrays.jl
data frame DataFrame DataFrames.jl

If conversion to the Julia type is not supported (e.g. R closure or language expression), load() will return the internal RData representation of the object (RSEXPREC subtype).

About

Read R data files from Julia

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Julia 95.5%
  • R 4.5%