Skip to content

Commit 62f0a55

Browse files
committed
Expose function 'sideCode'
1 parent 7876cf4 commit 62f0a55

File tree

8 files changed

+43
-13
lines changed

8 files changed

+43
-13
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: spatstat.utils
2-
Version: 3.1-4
3-
Date: 2025-05-15
2+
Version: 3.1-4.001
3+
Date: 2025-06-28
44
Title: Utility Functions for 'spatstat'
55
Authors@R: c(person("Adrian", "Baddeley",
66
role = c("aut", "cre"),

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ export("rhs.of.formula<-")
173173
export("samefunction")
174174
export("sensiblevarname")
175175
export("short.deparse")
176+
export("sideCode")
176177
export("simplenumber")
177178
export("simplify.xypolygon")
178179
export("singlestring")

NEWS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11

2+
CHANGES IN spatstat.utils VERSION 3.1-4.001
3+
4+
OVERVIEW
5+
6+
o Internal improvements.
7+
28
CHANGES IN spatstat.utils VERSION 3.1-4
39

410
OVERVIEW

R/utilarg.R

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#'
44
#' Utilities for checking/handling arguments
55
#'
6-
#' $Revision: 1.16 $ $Date: 2025/05/08 04:21:49 $
6+
#' $Revision: 1.18 $ $Date: 2025/06/28 02:29:54 $
77
#'
88

99
"%orifnull%" <- function(a, b) {
@@ -471,3 +471,17 @@ getdataobjects <- function(nama, envir, datalist=NULL, fatal=FALSE) {
471471
return(y)
472472
}
473473

474+
sideCode <- function(side, what=c("number", "word")) {
475+
words <- c("bottom", "left", "top", "right")
476+
if(is.numeric(side)) {
477+
stopifnot(side %in% 1:4)
478+
n <- side
479+
} else if(is.character(side)) {
480+
side <- match.arg(side, words)
481+
n <- match(side, words)
482+
} else stop("Unrecognised format for 'side'")
483+
what <- match.arg(what)
484+
result <- switch(what, number=n, word=words[n])
485+
return(result)
486+
}
487+

inst/doc/packagesizes.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ date version nhelpfiles nobjects ndatasets Rlines srclines
2929
"2024-11-02" "3.1-1" 41 189 0 3614 2429
3030
"2025-03-15" "3.1-3" 42 192 0 3650 2429
3131
"2025-05-15" "3.1-4" 42 193 0 3689 2462
32+
"2025-06-28" "3.1-4.001" 42 194 0 3703 2462

inst/info/packagesizes.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ date version nhelpfiles nobjects ndatasets Rlines srclines
2929
"2024-11-02" "3.1-1" 41 189 0 3614 2429
3030
"2025-03-15" "3.1-3" 42 192 0 3650 2429
3131
"2025-05-15" "3.1-4" 42 193 0 3689 2462
32+
"2025-06-28" "3.1-4.001" 42 194 0 3703 2462

man/macros/defns.Rd

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,21 @@
55
\newcommand{\ege}{Ege Rubak \email{rubak@math.aau.dk}}
66
\newcommand{\spatstatAuthors}{\adrian, \rolf and \ege}
77
\newcommand{\spatstatAuthorsComma}{\adrian, \rolf, \ege}
8-
%% Contributors with emails
9-
\newcommand{\pavel}{Pavel Grabarnik \email{pavel.grabar@issp.serpukhov.su}}
10-
\newcommand{\dominic}{Dominic Schuhmacher \email{dominic.schuhmacher@mathematik.uni-goettingen.de}, URL \code{http://dominic.schuhmacher.name/}}
11-
\newcommand{\wei}{Ang Qi Wei \email{aqw07398@hotmail.com}}
12-
\newcommand{\colette}{Marie-Colette van Lieshout \email{Marie-Colette.van.Lieshout@cwi.nl}}
13-
\newcommand{\rasmus}{Rasmus Plenge Waagepetersen \email{rw@math.auc.dk}}
8+
%% Contributors with emails (alphabetical order)
149
\newcommand{\abdollah}{Abdollah Jalilian \email{jalilian@razi.ac.ir}}
10+
\newcommand{\colette}{Marie-Colette van Lieshout \email{Marie-Colette.van.Lieshout@cwi.nl}}
11+
\newcommand{\dominic}{Dominic Schuhmacher \email{dominic.schuhmacher@mathematik.uni-goettingen.de}, URL \code{http://dominic.schuhmacher.name/}}
12+
\newcommand{\martinH}{Martin Hazelton \email{Martin.Hazelton@otago.ac.nz}}
13+
\newcommand{\mehdi}{Mehdi Moradi \email{m2.moradi@yahoo.com}}
1514
\newcommand{\ottmar}{Ottmar Cronie \email{ottmar@chalmers.se}}
15+
\newcommand{\pavel}{Pavel Grabarnik \email{pavel.grabar@issp.serpukhov.su}}
16+
\newcommand{\rasmus}{Rasmus Plenge Waagepetersen \email{rw@math.auc.dk}}
1617
\newcommand{\stephenEglen}{Stephen Eglen \email{S.J.Eglen@damtp.cam.ac.uk}}
17-
\newcommand{\mehdi}{Mehdi Moradi \email{m2.moradi@yahoo.com}}
18-
\newcommand{\yamei}{Ya-Mei Chang \email{yamei628@gmail.com}}
19-
\newcommand{\martinH}{Martin Hazelton \email{Martin.Hazelton@otago.ac.nz}}
18+
\newcommand{\suman}{Suman Rakshit \email{Suman.Rakshit@curtin.edu.au}}
2019
\newcommand{\tilman}{Tilman Davies \email{Tilman.Davies@otago.ac.nz}}
21-
% Names with accents
20+
\newcommand{\wei}{Ang Qi Wei \email{aqw07398@hotmail.com}}
21+
\newcommand{\yamei}{Ya-Mei Chang \email{yamei628@gmail.com}}
22+
% Names with accents (alphabetical order)
2223
\newcommand{\Bogsted}{\ifelse{latex}{\out{B\o gsted}}{Bogsted}}
2324
\newcommand{\Cramer}{\ifelse{latex}{\out{Cram\'er}}{Cramer}}
2425
\newcommand{\Francois}{\ifelse{latex}{\out{Fran\c{c}ois}}{Francois}}
@@ -46,5 +47,9 @@
4647
\newcommand{\baddchangclustersim}{Baddeley, A. and Chang, Y.-M. (2023) Robust algorithms for simulating cluster point processes. \emph{Journal of Statistical Computation and Simulation} \bold{93}, 1950--1975.}
4748
\newcommand{\smoothpcfpaper}{Baddeley, A., Davies, T.M. and Hazelton, M.L. (2025) An improved estimator of the pair correlation function of a spatial point process. \emph{Biometrika}, to appear.}
4849
\newcommand{\smoothpcfpapercite}{Baddeley, Davies and Hazelton (2025)}
50+
%% ROC paper
51+
\newcommand{\rocketAuthors}{\adrian, \ege and \suman}
52+
\newcommand{\rocpapercite}{Baddeley et al (2025)}
53+
\newcommand{\rocpaper}{Baddeley, A., Rubak, E., Rakshit, S. and Nair, G. (2025) ROC curves for spatial point patterns and presence-absence data. \url{https://doi.org/10.48550/arXiv.2506.03414}.}
4954
5055

man/spatstat.utils-internal.Rd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
\alias{samefunction}
7777
\alias{sensiblevarname}
7878
\alias{short.deparse}
79+
\alias{sideCode}
7980
\alias{singlestring}
8081
\alias{sortunique}
8182
\alias{startinrange}
@@ -186,6 +187,7 @@ ratiotweak(a, b, overzero, zerozero)
186187
samefunction(f, g)
187188
sensiblevarname(guess, fallback, maxlen)
188189
short.deparse(x, maxlen)
190+
sideCode(side, what)
189191
singlestring(s, coll)
190192
sortunique(x)
191193
startinrange(x0, dx, r)

0 commit comments

Comments
 (0)