Skip to content

Commit

Permalink
seq(x,x,by=2) bug fixed
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/branches/R-0-62-patches@2654 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
maechler committed Oct 28, 1998
1 parent 1e7ae85 commit 71c379b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/library/base/R/seq.R
Expand Up @@ -2,7 +2,7 @@ seq <- function(x, ...) UseMethod("seq")

seq.default <-
function(from = 1, to = 1, by = ((to - from)/(length.out - 1)),
length.out = NULL, along.with = NULL) {
length.out = NULL, along.with = NULL) {
if(!missing(along.with))
length.out <- length(along.with)
else if(!missing(length.out))
Expand All @@ -18,7 +18,9 @@ function(from = 1, to = 1, by = ((to - from)/(length.out - 1)),
from:to
else {
n <- (del <- to - from)/by
if(is.na(n)) {
if(del == 0)
return(from)
else if(is.na(n)) {
if(by == 0 && del == 0)
return(from)
else stop("invalid (to - from)/by in seq(.)")
Expand Down

0 comments on commit 71c379b

Please sign in to comment.