module Rust::RBindings

Public Instance Methods

boxplot(*args, **options) click to toggle source
# File lib/rust-plots.rb, line 440
def boxplot(*args, **options)
    result = Rust::Plots::BoxPlot.new
    options.each do |k, v|
        result[k] = v
    end
    
    result._do_not_override_options!
    
    args.each do |s|
        result.series(s)
    end
    
    result.show
end
cliff_delta(d1, d2) click to toggle source
# File lib/rust-effsize.rb, line 80
def cliff_delta(d1, d2)
    Rust::EffectSize::CliffDelta.compute(d1, d2)
end
cohen_d(d1, d2, **args) click to toggle source
# File lib/rust-effsize.rb, line 84
def cohen_d(d1, d2, **args)
    Rust::EffectSize::CohenD.compute(d1, d2)
end
cor(d1, d2, **options) click to toggle source
# File lib/rust-basics.rb, line 116
def cor(d1, d2, **options)
    return cor_test(d1, d2, **options).correlation
end
cor_test(d1, d2, **options) click to toggle source
# File lib/rust-basics.rb, line 120
def cor_test(d1, d2, **options)
    method = options[:method].to_s.downcase
    if "pearson".start_with?(method)
        return Rust::Correlation::Pearson.test(d1, d2)
    elsif "spearman".start_with?(method)
        return Rust::Correlation::Spearman.test(d1, d2)
    elsif "kendall".start_with?(method)
        return Rust::Correlation::Kendall.test(d1, d2)
    else
        raise "Unsupported method #{method}"
    end
end
data_frame(*args) click to toggle source
# File lib/rust-core.rb, line 822
def data_frame(*args)
    Rust::DataFrame.new(*args)
end
plot(x, y=(1..x.size).to_a, **options) click to toggle source
# File lib/rust-plots.rb, line 428
def plot(x, y=(1..x.size).to_a, **options)
    result = Rust::Plots::ScatterPlot.new(x, y)
    
    options.each do |k, v|
        result[k] = v
    end
    
    result._do_not_override_options!
    
    result.show
end
read_csv(filename, **options) click to toggle source
# File lib/rust-csv.rb, line 97
def read_csv(filename, **options)
    Rust::CSV.read(filename, **options)
end
t_test(d1, d2, **args) click to toggle source
# File lib/rust-tests.rb, line 290
def t_test(d1, d2, **args)
    paired = args[:paired] || false
    if paired
        return Rust::StatisticalTests::T.paired(d1, d2)
    else
        return Rust::StatisticalTests::T.unpaired(d1, d2)
    end
end
wilcox_test(d1, d2, **args) click to toggle source
# File lib/rust-tests.rb, line 281
def wilcox_test(d1, d2, **args)
    paired = args[:paired] || false
    if paired
        return Rust::StatisticalTests::Wilcoxon.paired(d1, d2)
    else
        return Rust::StatisticalTests::Wilcoxon.unpaired(d1, d2)
    end
end
write_csv(filename, dataframe, **options) click to toggle source
# File lib/rust-csv.rb, line 101
def write_csv(filename, dataframe, **options)
    Rust::CSV.write(filename, dataframe, **options)
end