An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20120904/e94843f5/attachment.pl>
adding points to a point pattern
7 messages · Frederico Mestre, Jeff Newmiller, Rolf Turner
Perhaps.
What does this have to do with R?
---------------------------------------------------------------------------
Jeff Newmiller The ..... ..... Go Live...
DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go...
Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#. with
/Software/Embedded Controllers) .OO#. .OO#. rocks...1k
---------------------------------------------------------------------------
Sent from my phone. Please excuse my brevity.
Frederico Mestre <mestre.frederico at gmail.com> wrote:
Hello all: Is there any way to add points to a point pattern, while keeping a given minimum distance amongst this new points and the pre-existing points? Thanks, Frederico [[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Hello,
I'm trying to make a function in R in which I need to do this.
Frederico
-----Mensagem original-----
De: Jeff Newmiller [mailto:jdnewmil at dcn.davis.CA.us]
Enviada em: ter?a-feira, 4 de Setembro de 2012 01:30
Para: Frederico Mestre; r-help at r-project.org
Assunto: Re: [R] adding points to a point pattern
Perhaps.
What does this have to do with R?
---------------------------------------------------------------------------
Jeff Newmiller The ..... ..... Go Live...
DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go...
Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#. with
/Software/Embedded Controllers) .OO#. .OO#. rocks...1k
---------------------------------------------------------------------------
Sent from my phone. Please excuse my brevity.
Frederico Mestre <mestre.frederico at gmail.com> wrote:
Hello all: Is there any way to add points to a point pattern, while keeping a given minimum distance amongst this new points and the pre-existing points? Thanks, Frederico [[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
On 04/09/12 11:58, Frederico Mestre wrote:
Hello all: Is there any way to add points to a point pattern, while keeping a given minimum distance amongst this new points and the pre-existing points?
Presumably this is a question about the "spatstat" package.
If so, the answer is "yes". At least two ways:
(1) Using rmh() --- need to specify "beta" (the "chemical" activity
parameter). E.g.
# Generate a "test pattern" to which to add points.
set.seed(42)
X <- rSSI(0.05,100)
# Add points.
M <- rmhmodel(cif="hardcore",par=list(beta=300,hc=0.05))
Y <-
rmh(M,start=list(x.start=X),expand=1,control=list(x.cond=as.data.frame(X)))
plot(Y,main="Pattern with points added via rmh")
plot(X,add=TRUE,chars=20,cols="red")
print(min(nndist(Y)))
(2) Using rSSI() --- need to specify the *total number* of points
desired. E.g.
# Add points to the same "test pattern", in a different way.
Z <- rSSI(0.05,npoints(X)+42,x.init=X)
plot(Z,main="Pattern with points added via rSSI")
plot(X,add=TRUE,chars=20,cols="red")
print(min(nndist(Z)))
HTH
cheers,
Rolf Turner
Hello, Yes, I'm using spatstat. Sorry, I forgot to mention that. Thanks, Frederico -----Mensagem original----- De: Rolf Turner [mailto:rolf.turner at xtra.co.nz] Enviada em: ter?a-feira, 4 de Setembro de 2012 02:04 Para: Frederico Mestre Cc: r-help at r-project.org; Adrian.Baddeley at csiro.au Assunto: Re: [R] adding points to a point pattern
On 04/09/12 11:58, Frederico Mestre wrote:
Hello all: Is there any way to add points to a point pattern, while keeping a given minimum distance amongst this new points and the pre-existing
points?
Presumably this is a question about the "spatstat" package.
If so, the answer is "yes". At least two ways:
(1) Using rmh() --- need to specify "beta" (the "chemical" activity
parameter). E.g.
# Generate a "test pattern" to which to add points.
set.seed(42)
X <- rSSI(0.05,100)
# Add points.
M <- rmhmodel(cif="hardcore",par=list(beta=300,hc=0.05))
Y <-
rmh(M,start=list(x.start=X),expand=1,control=list(x.cond=as.data.frame(X)))
plot(Y,main="Pattern with points added via rmh")
plot(X,add=TRUE,chars=20,cols="red")
print(min(nndist(Y)))
(2) Using rSSI() --- need to specify the *total number* of points desired.
E.g.
# Add points to the same "test pattern", in a different way.
Z <- rSSI(0.05,npoints(X)+42,x.init=X)
plot(Z,main="Pattern with points added via rSSI")
plot(X,add=TRUE,chars=20,cols="red")
print(min(nndist(Z)))
HTH
cheers,
Rolf Turner
Then why don't you follow the posting guide and provide an R sample data set and R sample result?
---------------------------------------------------------------------------
Jeff Newmiller The ..... ..... Go Live...
DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go...
Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#. with
/Software/Embedded Controllers) .OO#. .OO#. rocks...1k
---------------------------------------------------------------------------
Sent from my phone. Please excuse my brevity.
Frederico Mestre <mestre.frederico at gmail.com> wrote:
Hello,
I'm trying to make a function in R in which I need to do this.
Frederico
-----Mensagem original-----
De: Jeff Newmiller [mailto:jdnewmil at dcn.davis.CA.us]
Enviada em: ter?a-feira, 4 de Setembro de 2012 01:30
Para: Frederico Mestre; r-help at r-project.org
Assunto: Re: [R] adding points to a point pattern
Perhaps.
What does this have to do with R?
---------------------------------------------------------------------------
Jeff Newmiller The ..... ..... Go
Live...
DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live
Go...
Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#. with
/Software/Embedded Controllers) .OO#. .OO#.
rocks...1k
---------------------------------------------------------------------------
Sent from my phone. Please excuse my brevity.
Frederico Mestre <mestre.frederico at gmail.com> wrote:
Hello all: Is there any way to add points to a point pattern, while keeping a given minimum distance amongst this new points and the pre-existing points? Thanks, Frederico [[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
I had no trouble in figuring out what he wanted.
cheers,
Rolf Turner
On 04/09/12 14:26, Jeff Newmiller wrote:
Then why don't you follow the posting guide and provide an R sample data set and R sample result?
---------------------------------------------------------------------------
Jeff Newmiller The ..... ..... Go Live...
DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go...
Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#. with
/Software/Embedded Controllers) .OO#. .OO#. rocks...1k
---------------------------------------------------------------------------
Sent from my phone. Please excuse my brevity.
Frederico Mestre <mestre.frederico at gmail.com> wrote:
Hello,
I'm trying to make a function in R in which I need to do this.
Frederico
-----Mensagem original-----
De: Jeff Newmiller [mailto:jdnewmil at dcn.davis.CA.us]
Enviada em: ter?a-feira, 4 de Setembro de 2012 01:30
Para: Frederico Mestre; r-help at r-project.org
Assunto: Re: [R] adding points to a point pattern
Perhaps.
What does this have to do with R?
---------------------------------------------------------------------------
Jeff Newmiller The ..... ..... Go
Live...
DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live
Go...
Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#. with
/Software/Embedded Controllers) .OO#. .OO#.
rocks...1k
---------------------------------------------------------------------------
Sent from my phone. Please excuse my brevity.
Frederico Mestre <mestre.frederico at gmail.com> wrote:
Hello all: Is there any way to add points to a point pattern, while keeping a given minimum distance amongst this new points and the pre-existing points? Thanks, Frederico