Skip to content

Commit

Permalink
Reduce check time; ready for CRAN
Browse files Browse the repository at this point in the history
  • Loading branch information
baddstats committed Mar 13, 2023
1 parent 600a4fe commit fae3ec3
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 35 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: spatstat.random
Version: 3.1-3.008
Date: 2023-03-04
Version: 3.1-4
Date: 2023-03-13
Title: Random Generation Functionality for the 'spatstat' Family
Authors@R: c(person("Adrian", "Baddeley",
role = c("aut", "cre"),
Expand Down Expand Up @@ -31,7 +31,7 @@ Authors@R: c(person("Adrian", "Baddeley",
role = "ctb"))
Maintainer: Adrian Baddeley <[email protected]>
Depends: R (>= 3.5.0), spatstat.data (>= 3.0), spatstat.geom (>= 3.0-5), stats, utils, methods, grDevices
Imports: spatstat.utils (>= 3.0-1.004)
Imports: spatstat.utils (>= 3.0-2)
Suggests: spatial, RandomFields (>= 3.1.24.1), RandomFieldsUtils (>= 0.3.3.1), spatstat.linnet (>= 3.0), spatstat.explore, spatstat.model, spatstat (>= 3.0), gsl
Additional_repositories: https://spatstat.r-universe.dev
Description: Functionality for random generation of spatial data in the 'spatstat' family of packages.
Expand Down
2 changes: 1 addition & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

CHANGES IN spatstat.random VERSION 3.1-3.008
CHANGES IN spatstat.random VERSION 3.1-4

OVERVIEW

Expand Down
2 changes: 1 addition & 1 deletion inst/doc/packagesizes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ date version nhelpfiles nobjects ndatasets Rlines srclines
"2022-11-02" "3.0-1" 78 145 0 8978 7403
"2022-11-06" "3.0-2" 79 149 0 9158 7403
"2023-01-25" "3.1-3" 80 160 0 11263 9229
"2023-03-04" "3.1-3.008" 82 163 0 11301 9229
"2023-03-13" "3.1-4" 82 163 0 11301 9229
30 changes: 18 additions & 12 deletions man/rLGCP.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -116,20 +116,26 @@ For fitting the model, see \code{\link[spatstat.model]{kppm}},
}
\examples{
if(require(RandomFields)) {
# homogeneous LGCP with exponential covariance function
X <- rLGCP("exp", 3, var=0.2, scale=.1)

# inhomogeneous LGCP with Gaussian covariance function
m <- as.im(function(x, y){5 - 1.5 * (x - 0.5)^2 + 2 * (y - 0.5)^2}, W=owin())
X <- rLGCP("gauss", m, var=0.15, scale =0.5)
plot(attr(X, "Lambda"))
points(X)
online <- interactive()

# inhomogeneous LGCP with Matern covariance function
X <- rLGCP("matern", function(x, y){ 1 - 0.4 * x},
var=2, scale=0.7, nu=0.5,
win = owin(c(0, 10), c(0, 10)))
plot(X)
# homogeneous LGCP with exponential covariance function
X <- rLGCP("exp", 3, var=0.2, scale=.1)

# inhomogeneous LGCP with Gaussian covariance function
m <- as.im(function(x, y){5 - 1.5 * (x - 0.5)^2 + 2 * (y - 0.5)^2}, W=owin())
X <- rLGCP("gauss", m, var=0.15, scale =0.5)

if(online) {
plot(attr(X, "Lambda"))
points(X)
}

# inhomogeneous LGCP with Matern covariance function
X <- rLGCP("matern", function(x, y){ 1 - 0.4 * x},
var=2, scale=0.7, nu=0.5,
win = owin(c(0, 10), c(0, 10)))
if(online) plot(X)
}
}
\author{Abdollah Jalilian and Rasmus Waagepetersen.
Expand Down
10 changes: 3 additions & 7 deletions man/rMosaicField.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,16 @@ rMosaicField(X,
\value{
A pixel image (object of class \code{"im"}).
}
\author{\adrian


and \rolf

}
\author{\adrian and \rolf}
\seealso{
\code{\link{rpoislinetess}},
\code{\link{rMosaicSet}}
}
\examples{
X <- rpoislinetess(3)
plot(rMosaicField(X, runif))
plot(rMosaicField(X, runif, dimyx=256))
d <- if(interactive()) 32 else 256
plot(rMosaicField(X, runif, dimyx=d))
plot(rMosaicField(X, rnorm, rgenargs=list(mean=10, sd=2)))

plot(rMosaicField(dirichlet(runifpoint(30)), rnorm))
Expand Down
9 changes: 2 additions & 7 deletions man/rMosaicSet.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@ rMosaicSet(X, p=0.5)
A random set process in the plane with a Markovian property.
\emph{Annals of Mathematical Statistics} \bold{36} (1965) 1859--1863.
}
\author{\adrian
and \rolf
}
\author{\adrian and \rolf}
\seealso{
\code{\link{rpoislinetess}},
\code{\link{rMosaicField}}
Expand All @@ -52,7 +47,7 @@ rMosaicSet(X, p=0.5)
plot(rMosaicSet(X, 0.5), col="green", border=NA)

# another example
plot(rMosaicSet(dirichlet(runifpoint(30)), 0.4))
plot(rMosaicSet(dirichlet(runifpoint(20)), 0.4))
}
\keyword{spatial}
\keyword{datagen}
19 changes: 15 additions & 4 deletions man/rPSNCP.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,12 @@
kappa <- c(30, 25, 20, 25)
omega <- c(0.02, 0.025, 0.03, 0.02)
alpha <- matrix(runif(16, -1, 1), nrow=4, ncol=4)
if(!online) lambda <- lambda/10
if(!online) {
lambda <- lambda[1:3]/10
kappa <- kappa[1:3]
omega <- omega[1:3]
alpha <- alpha[1:3, 1:3]
}
X <- rPSNCP(lambda, kappa, omega, alpha)
if(online) {
plot(X)
Expand All @@ -158,9 +163,15 @@
kappa <- c(35, 30, 20, 25) / (1000 * 500)
omega <- c(15, 35, 40, 25)
alpha <- matrix(runif(16, -1, 1), nrow=4, ncol=4)
if(!online) lambda <- lapply(lambda, "/", e2=10)
sapply(lambda, integral)
X <- rPSNCP(lambda, kappa, omega, alpha, win = bei$window, dimyx=dim(z1))
if(!online) {
lambda <- lapply(lambda[1:3], "/", e2=10)
kappa <- kappa[1:3]
omega <- omega[1:3]
alpha <- alpha[1:3, 1:3]
} else {
sapply(lambda, integral)
}
X <- rPSNCP(lambda, kappa, omega, alpha, win = Window(bei), dimyx=dim(z1))
if(online) {
plot(X)
plot(split(X), cex=0.5)
Expand Down

0 comments on commit fae3ec3

Please sign in to comment.