dnychka/fieldsRPackage

fields::circulantEmbeddingSetup question

Closed this issue · 4 comments

Hi,

I am getting this error if (any(d < 0)) stop("distance argument must be nonnegative"): missing value where TRUE/FALSE needed when running the follow function:

  # create object for simulation
  obj <- fields::circulantEmbeddingSetup(
    grid = list(
      x = seq(0, 5, length.out = terra::nrow(x)),
      y = seq(0, 5, length.out = terra::ncol(x))
    ),
    Covariance = "Exponential",
    aRange = scale
  )

I am unsure how to debug this one. Wondering if you had any suggestions?

Thanks!

Thanks,

terra::nrow(x) = 1 AND terra::ncol(x) = 2

Thanks for your responses dynchka, my data going into the function was the problem as you mentioned. Cheers.