Giter VIP home page Giter VIP logo

Comments (5)

rubak avatar rubak commented on June 12, 2024

At the moment ppp doesn't allow any NA vaules. Can't you just filter out the NA values in your call to ppp?

x <- c(NA_real_, NA_real_)
y <- c(NA_real_, NA_real_)
ppp(na.omit(x), na.omit(y), xrange = 0:1, yrange = 0:1)

from spatstat.

baddstats avatar baddstats commented on June 12, 2024

I don't see a reason for the latter to error given the former works just fine

The two situations are completely different. NA is not the same as c() or numeric(0). In ppp(xrange, yrange) the coordinate vectors x and y have not been specified, so they default to numeric(0) yielding an empty point pattern. In ppp(NA, NA, xrange, yrange) the coordinates have been specified as a vector of length 1 containing NA. This is an error because ppp objects must not contain NA coordinate values (or a whole lot of code will break).

However, we could tweak ppp so that NA coordinate values are removed with a warning. I will discuss with the three amigos.

from spatstat.

MichaelChirico avatar MichaelChirico commented on June 12, 2024

@baddstats thanks for the reply.

I understand the two are different -- this may be a case of a misleading error message, then.

See the edit -- the error I receive doesn't imply ppp can't handle missing values, but rather that the problem is there are no non-missing values. So in fact the error message is suggesting the source of the problem is exactly a numeric(0) issue.

Now I see that passing numeric(0) is not an error; thanks for correcting my understanding.

from spatstat.

baddstats avatar baddstats commented on June 12, 2024

Experimental code now inserted in ppp (in spatstat 1.49-0.004)

from spatstat.

baddstats avatar baddstats commented on June 12, 2024

For the record, ppp does not allow any coordinate values to be NA, NaN or infinite.
I will re-write the error message and the help file to make this abundantly clear.

from spatstat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.