Closed MichalLauer closed 4 months ago
aha so the order of variables was the wrong way around?
Would you mind just running a reprex before and after the error so I can see the fix? (sorry on a computer that doesn't play nicely with R)
Sure,
Before fix:
# Laplace distribution
distr6::Laplace$new(var = 4)
#> Error in vars/2: non-numeric argument to binary operator
# Logistic distribution
distr6::Logistic$new(sd = 1)$getParameterValue('mean')
#> Error in expand_list(self$ids, x): ids in 'names' not in 'named_var'
distr6::Logistic$new(sd = 1)$getParameterValue('scale')
#> Error in expand_list(self$ids, x): ids in 'names' not in 'named_var'
distr6::Logistic$new(sd = 1)$getParameterValue('sd')
#> Error in expand_list(self$ids, x): ids in 'names' not in 'named_var'
# Weibull distribution
distr6::Weibull$new(altscale = 3)$getParameterValue("shape")
#> Error in expand_list(self$ids, x): ids in 'names' not in 'named_var'
distr6::Weibull$new(altscale = 3)$getParameterValue("scale")
#> Error in expand_list(self$ids, x): ids in 'names' not in 'named_var'
distr6::Weibull$new(altscale = 3)$getParameterValue("altscale")
#> Error in expand_list(self$ids, x): ids in 'names' not in 'named_var'
After fix:
# Laplace distribution
distr6::Laplace$new(var = 4)
#> Lap(mean = 0, var = 4)
# Logistic distribution
distr6::Logistic$new(sd = 1)$getParameterValue('mean')
#> [1] 0
distr6::Logistic$new(sd = 1)$getParameterValue('scale')
#> [1] 0.5513289
distr6::Logistic$new(sd = 1)$getParameterValue('sd')
#> [1] 1
# Weibull distribution
distr6::Weibull$new(altscale = 3)$getParameterValue("shape")
#> [1] 1
distr6::Weibull$new(altscale = 3)$getParameterValue("scale")
#> [1] 0.3333333
distr6::Weibull$new(altscale = 3)$getParameterValue("altscale")
#> [1] 3
Thanks! That's weird previous checks passed ... But good to see it's a breaking error and not a silent one
Replacement for #302 , should be much better. Sorry!:)
Proposed changes
This PR fixes several bugs within distributions.
Types of changes
Put an
x
in the boxes that apply or remove the lines that don't.Checklist
Put an
x
in the boxes that apply or remove the lines that don't. This is a reminder of what we are going to look for before merging your code.Further comments
Fixes the following errors: