Class: PubliSci::Client
- Inherits:
-
Object
show all
- Includes:
- Rconnect
- Defined in:
- lib/bio-publisci/r_client.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from Rconnect
#connect, #get, #get_vars, #load_workspace
Constructor Details
#initialize(auto = true, loc = Dir.home) ⇒ Client
Returns a new instance of Client.
31
32
33
34
35
36
|
# File 'lib/bio-publisci/r_client.rb', line 31
def initialize(auto=true, loc=Dir.home)
@R = connect
@loc = loc
load_ws if auto
puts "vars: #{vars.payload}" if auto
end
|
Instance Attribute Details
#R ⇒ Object
Returns the value of attribute R.
29
30
31
|
# File 'lib/bio-publisci/r_client.rb', line 29
def R
@R
end
|
Instance Method Details
#get_var(var) ⇒ Object
42
43
44
|
# File 'lib/bio-publisci/r_client.rb', line 42
def get_var(var)
get(@R,var)
end
|
#get_ws ⇒ Object
46
47
48
|
# File 'lib/bio-publisci/r_client.rb', line 46
def get_ws
"#{@loc}/.RData"
end
|
#load_ws ⇒ Object
38
39
40
|
# File 'lib/bio-publisci/r_client.rb', line 38
def load_ws
load_workspace(@R, @loc)
end
|
#vars ⇒ Object
50
51
52
|
# File 'lib/bio-publisci/r_client.rb', line 50
def vars
get_vars(@R)
end
|