-
Notifications
You must be signed in to change notification settings - Fork 1
RCallPyCall
WooKyoung Noh edited this page Dec 3, 2015
·
2 revisions
λ ~ julia
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "?help" for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.5.0-dev+1573 (2015-12-03 01:35 UTC)
_/ |\__'_|_|_|\__'_| | Commit 0d0b6bc* (0 days old master)
|__/ | x86_64-apple-darwin15.0.0
julia> using RCall
INFO: Recompiling stale cache file /Users/wookyoung/.julia/lib/v0.5/DataFrames.ji for module DataFrames.
INFO: Recompiling stale cache file /Users/wookyoung/.julia/lib/v0.5/StatsBase.ji for module StatsBase.
INFO: Recompiling stale cache file /Users/wookyoung/.julia/lib/v0.5/ArrayViews.ji for module ArrayViews.
INFO: Recompiling stale cache file /Users/wookyoung/.julia/lib/v0.5/StatsFuns.ji for module StatsFuns.
INFO: Recompiling stale cache file /Users/wookyoung/.julia/lib/v0.5/DataArrays.ji for module DataArrays.
INFO: Recompiling stale cache file /Users/wookyoung/.julia/lib/v0.5/GZip.ji for module GZip.
INFO: Recompiling stale cache file /Users/wookyoung/.julia/lib/v0.5/SortingAlgorithms.ji for module SortingAlgorithms.
INFO: Recompiling stale cache file /Users/wookyoung/.julia/lib/v0.5/Docile.ji for module Docile.
julia> using PyCall
INFO: Recompiling stale cache file /Users/wookyoung/.julia/lib/v0.5/PyCall.ji for module PyCall.
julia> @pyimport numpy as np
julia> a = "c(1,2,3)" |> rcopy
3-element Array{Float64,1}:
1.0
2.0
3.0
julia> np.mean(a)
2.0
julia> reval("""
f <- function(n) {
return (n+1)
}
""")
RCall.RObject{RCall.ClosSxp}
function (n)
{
return(n + 1)
}
julia> rcopy(rcall(:f, 2))
3.0