cbain1
March 5, 2021, 6:08pm
1
No matter what inputs I use, it seems to give this output
Iter = 94 | Mean = 1.048428 | Best = 1.047688
Iter = 95 | Mean = 1.048798 | Best = 1.047688
Iter = 96 | Mean = 1.049274 | Best = 1.047688
Iter = 97 | Mean = 1.048428 | Best = 1.047688
Iter = 98 | Mean = 1.048899 | Best = 1.047688
Iter = 99 | Mean = 1.048428 | Best = 1.047688
Iter = 100 | Mean = 1.048058 | Best = 1.047688
Error in sign(list.i) : non-numeric argument to mathematical function
Is there something that I am doing wrong?
Thank you!
And what were you doing and with what. What were you expecting as output?
We need to see your original code and some sample data. See
A minimal reproducible example consists of the following items:
A minimal dataset, necessary to reproduce the issue
The minimal runnable code necessary to reproduce the issue, which can be run
on the given dataset, and including the necessary information on the used packages.
Let's quickly go over each one of these with examples:
Minimal Dataset (Sample Data)
You need to provide a data frame that is small enough to be (reasonably) pasted on a post, but big enough to reproduce your issue.
Let's say, as an example, that you are working with the iris data frame
head(iris)
#> Sepal.Length Sepal.Width Petal.Length Petal.Width Species
#> 1 5.1 3.5 1.4 0.…
or
Why reprex?
Getting unstuck is hard. Your first step here is usually to create a reprex, or reproducible example. The goal of a reprex is to package your code, and information about your problem so that others can run it and feel your pain. Then, hopefully, folks can more easily provide a solution.
What's in a Reproducible Example?
Parts of a reproducible example:
background information - Describe what you are trying to do. What have you already done?
complete set up - include any library() calls and data to reproduce your issue.
data for a reprex: Here's a discussion on setting up data for a reprex
make it run - include the minimal code required to reproduce your error on the data…
is all there is to go on. @jrkrideau is right—that's notmuch.
The error message is complaining that the sign
function is expecting a numeric vector and the list.i
argument isn't one.
How that came to be is invisible with what can be seen in the OP.
system
Closed
March 26, 2021, 10:20pm
4
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed. If you have a query related to it or one of the replies, start a new topic and refer back with a link.