rust 0.7 → 0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/ruby-rust +3 -0
- data/lib/{rust-csv.rb → rust/core/csv.rb} +2 -1
- data/lib/rust/core/rust.rb +157 -0
- data/lib/rust/core/types/all.rb +4 -0
- data/lib/{rust-core.rb → rust/core/types/dataframe.rb} +17 -335
- data/lib/rust/core/types/datatype.rb +161 -0
- data/lib/rust/core/types/factor.rb +131 -0
- data/lib/rust/core/types/language.rb +166 -0
- data/lib/rust/core/types/list.rb +81 -0
- data/lib/rust/core/types/matrix.rb +132 -0
- data/lib/rust/core/types/s4class.rb +59 -0
- data/lib/rust/core/types/utils.rb +109 -0
- data/lib/rust/core.rb +7 -0
- data/lib/rust/models/all.rb +4 -0
- data/lib/rust/models/anova.rb +60 -0
- data/lib/rust/models/regression.rb +205 -0
- data/lib/rust/plots/all.rb +4 -0
- data/lib/rust/plots/basic-plots.rb +111 -0
- data/lib/{rust-plots.rb → rust/plots/core.rb} +1 -169
- data/lib/rust/plots/distribution-plots.rb +62 -0
- data/lib/rust/stats/all.rb +4 -0
- data/lib/{rust-basics.rb → rust/stats/correlation.rb} +2 -2
- data/lib/{rust-descriptive.rb → rust/stats/descriptive.rb} +24 -4
- data/lib/{rust-effsize.rb → rust/stats/effsize.rb} +7 -13
- data/lib/{rust-probabilities.rb → rust/stats/probabilities.rb} +1 -1
- data/lib/{rust-tests.rb → rust/stats/tests.rb} +84 -90
- data/lib/rust.rb +4 -9
- metadata +31 -13
- data/lib/rust-calls.rb +0 -80
data/lib/rust-calls.rb
DELETED
@@ -1,80 +0,0 @@
|
|
1
|
-
require_relative 'rust-core'
|
2
|
-
|
3
|
-
module Rust
|
4
|
-
class Function
|
5
|
-
attr_reader :name
|
6
|
-
attr_reader :arguments
|
7
|
-
attr_reader :options
|
8
|
-
|
9
|
-
def initialize(name)
|
10
|
-
@function = name
|
11
|
-
@arguments = Arguments.new
|
12
|
-
@options = Options.new
|
13
|
-
end
|
14
|
-
|
15
|
-
def options=(options)
|
16
|
-
raise TypeError, "Expected Options" unless options.is_a?(Options)
|
17
|
-
|
18
|
-
@options = options
|
19
|
-
end
|
20
|
-
|
21
|
-
def arguments=(arguments)
|
22
|
-
raise TypeError, "Expected Arguments" unless options.is_a?(Arguments)
|
23
|
-
|
24
|
-
@arguments = arguments
|
25
|
-
end
|
26
|
-
|
27
|
-
def to_R
|
28
|
-
params = [@arguments.to_R, @options.to_R].select { |v| v != "" }.join(",")
|
29
|
-
return "#@function(#{params})"
|
30
|
-
end
|
31
|
-
|
32
|
-
def call
|
33
|
-
Rust._eval(self.to_R)
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
class SimpleFormula
|
38
|
-
def initialize(dependent, independent)
|
39
|
-
@dependent = dependent
|
40
|
-
@independent = independent
|
41
|
-
end
|
42
|
-
|
43
|
-
def to_R
|
44
|
-
return "#@dependent ~ #@independent"
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
class Variable
|
49
|
-
def initialize(name)
|
50
|
-
@name = name
|
51
|
-
end
|
52
|
-
|
53
|
-
def to_R
|
54
|
-
@name
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
class Arguments < Array
|
59
|
-
def to_R
|
60
|
-
return self.map { |v| v.to_R }.join(", ")
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
class Options < Hash
|
65
|
-
def to_R
|
66
|
-
return self.map { |k, v| "#{k}=#{v.to_R}" }.join(", ")
|
67
|
-
end
|
68
|
-
|
69
|
-
def self.from_hash(hash)
|
70
|
-
options = Options.new
|
71
|
-
hash.each do |key, value|
|
72
|
-
options[key.to_s] = value
|
73
|
-
end
|
74
|
-
return options
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
|
-
module Rust::RBindings
|
80
|
-
end
|