How to fix the error here, Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ

dscour<-function(u,d50,D,H,case){
  # Input
  #---------------------------
  #   u       = [1 x 1] Velocity of water
  #   d50     = [1 x 1] Sediment size
  #   D       = [n x 1] Pier diameters
  #   H       = [n x 1] Water depths
  #   case    = [1 x 1] Either open channel (1) or ice coverage (2)
  #------------------------
  # Output 
  #   ds      = [n x 1] Scour depth 
  #------------------------
  # Parametric study
  for(k in seq(1,length(H))){ # See the effect of D for a certain H
    H=H[k] # change H after seeing the effect of D
    for(j in seq(1,length(D))){ # change D at constant H
      D=D[j]
    }
  }
  plot(D/d50,ds/D)
  plot(H/D,ds/D)
  plot(((u^2)/(9.81*D)),ds/D)
}

'x' and 'y' lengths differ

Check those. Possibly in the D and H arguments.

Can you provide a reproducible example?

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.