Error in seq ...: wrong sign in "by" argument

I don't know which line of your code generates this error (I also don't understand what are n and msmooth), but I just wanted to point out that seq indeed has a by argument:

seq(from = 1, to = 1, by = ((to - from)/(length.out - 1)),
length.out = NULL, along.with = NULL, ...)

Also, note these:

seq(10, 100, 10)
#>  [1]  10  20  30  40  50  60  70  80  90 100
seq(10, 100, -10)
#> Error in seq.default(10, 100, -10): wrong sign in 'by' argument
seq(100, 10, -10)
#>  [1] 100  90  80  70  60  50  40  30  20  10
seq(100, 10, 10)
#> Error in seq.default(100, 10, 10): wrong sign in 'by' argument

Having this information, you may figure out the problem yourself.

In case you don't, please provide a REPRoducible EXample of your problem. It provides more specifics of your problem, and it helps others to understand what problem you are facing.

In case you don't know how to make a reprex, here's a great link:

2 Likes