Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tests/base.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
options("rgdal_show_exportToProj4_warnings"="none")
source("utils/print.R")

library(sp)
data(meuse)
x = meuse[1:10, ] # limit the output
Expand Down
12 changes: 7 additions & 5 deletions tests/base.Rout.save
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

R version 4.3.1 (2023-06-16) -- "Beagle Scouts"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Expand All @@ -16,6 +16,8 @@ Type 'demo()' for some demos, 'help()' for on-line help, or
Type 'q()' to quit R.

> options("rgdal_show_exportToProj4_warnings"="none")
> source("utils/print.R")
>
> library(sp)
> data(meuse)
> x = meuse[1:10, ] # limit the output
Expand Down Expand Up @@ -191,7 +193,7 @@ Data attributes:
Ga :2 Mean :174.5
Ag :1 3rd Qu.:277.5
(Other):1 Max. :470.0
NA's :1
NAs :1
>
> x[1:10] # first 10 columns
coordinates cadmium copper lead zinc elev dist om ffreq soil
Expand Down Expand Up @@ -460,4 +462,4 @@ Data attributes:
>
> proc.time()
user system elapsed
0.691 0.045 0.730
0.322 0.052 0.365
12 changes: 7 additions & 5 deletions tests/pass1.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
options("rgdal_show_exportToProj4_warnings"="none")
source("utils/print.R")

library(sp)
data(meuse)
x = meuse
Expand Down Expand Up @@ -61,9 +63,9 @@ SlDf = SpatialLinesDataFrame(Sl, data.frame(xx = c("foo", "bar")), match.ID = FA
summary(as(SlDf, "SpatialPointsDataFrame"))

meuse[["xxx"]] = log(meuse$zinc)
summary(meuse)
print(summary(meuse))
meuse$xxy = log(meuse[["zinc"]])
summary(meuse)
print(summary(meuse))

# test behaviour on zero-length objects:
demo(meuse, ask = FALSE, echo = FALSE)
Expand All @@ -81,11 +83,11 @@ dim(subset(meuse, F, 0))
dim(meuse.grid[0,])
fullgrid(meuse.grid) = TRUE
dim(meuse.grid[0,])
summary(meuse.grid[0,])
print(summary(meuse.grid[0,]))
dim(meuse.grid[,0])
summary(meuse.grid[,0])
print(summary(meuse.grid[,0]))
dim(meuse.grid[0,,0])
summary(meuse.grid[0,,0])
print(summary(meuse.grid[0,,0]))

# SpatialPolygons:
L = as(meuse.riv, "SpatialPolygons")
Expand Down
32 changes: 18 additions & 14 deletions tests/pass1.Rout.save
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

R version 4.3.2 (2023-10-31) -- "Eye Holes"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Expand All @@ -16,6 +16,8 @@ Type 'demo()' for some demos, 'help()' for on-line help, or
Type 'q()' to quit R.

> options("rgdal_show_exportToProj4_warnings"="none")
> source("utils/print.R")
>
> library(sp)
> data(meuse)
> x = meuse
Expand Down Expand Up @@ -70,7 +72,7 @@ Data attributes:
Mean : 7.478 Fw :10 Mean : 469.7
3rd Qu.: 9.000 Ab : 8 3rd Qu.: 674.5
Max. :17.000 (Other):25 Max. :1839.0
NA's :2 NA's : 1
NAs :2 NAs : 1
dist copper cadmium soil dist.m
Min. :0.00000 Min. : 14.00 Min. : 0.200 1:97 Min. : 10.0
1st Qu.:0.07569 1st Qu.: 23.00 1st Qu.: 0.800 2:46 1st Qu.: 80.0
Expand Down Expand Up @@ -215,7 +217,7 @@ Data attributes:
Max. :2.000 Max. :2.000
>
> meuse[["xxx"]] = log(meuse$zinc)
> summary(meuse)
> print(summary(meuse))
x y cadmium copper
Min. :178605 Min. :329714 Min. : 0.200 Min. : 14.00
1st Qu.:179371 1st Qu.:330762 1st Qu.: 0.800 1st Qu.: 23.00
Expand All @@ -239,7 +241,7 @@ Data attributes:
Mean : 7.478 Fw :10 Mean : 290.3
3rd Qu.: 9.000 Ab : 8 3rd Qu.: 450.0
Max. :17.000 (Other):25 Max. :1000.0
NA's :2 NA's : 1
NAs :2 NAs : 1
xxx
Min. :4.727
1st Qu.:5.288
Expand All @@ -249,7 +251,7 @@ Data attributes:
Max. :7.517

> meuse$xxy = log(meuse[["zinc"]])
> summary(meuse)
> print(summary(meuse))
x y cadmium copper
Min. :178605 Min. :329714 Min. : 0.200 Min. : 14.00
1st Qu.:179371 1st Qu.:330762 1st Qu.: 0.800 1st Qu.: 23.00
Expand All @@ -273,7 +275,7 @@ Data attributes:
Mean : 7.478 Fw :10 Mean : 290.3
3rd Qu.: 9.000 Ab : 8 3rd Qu.: 450.0
Max. :17.000 (Other):25 Max. :1000.0
NA's :2 NA's : 1
NAs :2 NAs : 1
xxx xxy
Min. :4.727 Min. :4.727
1st Qu.:5.288 1st Qu.:5.288
Expand Down Expand Up @@ -315,7 +317,7 @@ NULL
> fullgrid(meuse.grid) = TRUE
> dim(meuse.grid[0,])
[1] 8112 5
> summary(meuse.grid[0,])
> print(summary(meuse.grid[0,]))
Object of class SpatialGridDataFrame
Coordinates:
min max
Expand All @@ -332,10 +334,10 @@ y 329620 40 104
Data attributes:
part.a part.b dist soil ffreq
Mode:logical Mode:logical Mode:logical Mode:logical Mode:logical
NA's:8112 NA's:8112 NA's:8112 NA's:8112 NA's:8112
NAs :8112 NAs :8112 NAs :8112 NAs :8112 NAs :8112
> dim(meuse.grid[,0])
[1] 8112 5
> summary(meuse.grid[,0])
> print(summary(meuse.grid[,0]))
Object of class SpatialGridDataFrame
Coordinates:
min max
Expand All @@ -352,10 +354,10 @@ y 329620 40 104
Data attributes:
part.a part.b dist soil ffreq
Mode:logical Mode:logical Mode:logical Mode:logical Mode:logical
NA's:8112 NA's:8112 NA's:8112 NA's:8112 NA's:8112
NAs :8112 NAs :8112 NAs :8112 NAs :8112 NAs :8112
> dim(meuse.grid[0,,0])
[1] 8112 0
> summary(meuse.grid[0,,0])
> print(summary(meuse.grid[0,,0]))
Object of class SpatialGridDataFrame
Coordinates:
min max
Expand All @@ -369,6 +371,8 @@ Grid attributes:
cellcentre.offset cellsize cells.dim
x 178460 40 78
y 329620 40 104
Data attributes:
character(0)
>
> # SpatialPolygons:
> L = as(meuse.riv, "SpatialPolygons")
Expand Down Expand Up @@ -598,4 +602,4 @@ Error in SpatialPointsDataFrame(pts, df, match.ID = TRUE) :
>
> proc.time()
user system elapsed
1.033 1.316 0.843
0.783 0.067 0.842
2 changes: 2 additions & 0 deletions tests/sp1.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
options("rgdal_show_exportToProj4_warnings"="none")
source("utils/print.R")

library(sp)
data(meuse)
x = meuse
Expand Down
14 changes: 8 additions & 6 deletions tests/sp1.Rout.save
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

R version 4.3.1 (2023-06-16) -- "Beagle Scouts"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Expand All @@ -16,6 +16,8 @@ Type 'demo()' for some demos, 'help()' for on-line help, or
Type 'q()' to quit R.

> options("rgdal_show_exportToProj4_warnings"="none")
> source("utils/print.R")
>
> library(sp)
> data(meuse)
> x = meuse
Expand Down Expand Up @@ -92,15 +94,15 @@ Data attributes:
Mean : 8.165 Mean :0.24002 Mean : 7.478
3rd Qu.: 8.955 3rd Qu.:0.36407 3rd Qu.: 9.000
Max. :10.520 Max. :0.88039 Max. :17.000
NA's :2
NAs :2
landuse dist.m
W :50 Min. : 10.0
Ah :39 1st Qu.: 80.0
Am :22 Median : 270.0
Fw :10 Mean : 290.3
Ab : 8 3rd Qu.: 450.0
(Other):25 Max. :1000.0
NA's : 1
NAs : 1
> coordinates(x)
xcoord ycoord
1 181072 333611
Expand Down Expand Up @@ -331,4 +333,4 @@ Data attributes:
>
> proc.time()
user system elapsed
0.577 0.051 0.622
0.263 0.037 0.291
10 changes: 10 additions & 0 deletions tests/utils/print.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## print "NAs" as in R >= 4.6.0 to match reference output
if (getRversion() < "4.6.0") {
print <- function (x) {
if (inherits(x, "summary.Spatial"))
x$data <- sub("NA's", "NAs ", x$data, fixed = TRUE)
else if (is.table(x) && is.character(x))
x <- sub("NA's", "NAs ", x, fixed = TRUE)
base::print(x)
}
}
2 changes: 2 additions & 0 deletions tests/zerodist.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
options("rgdal_show_exportToProj4_warnings"="none")
source("utils/print.R")

library(sp)
data(meuse)
# pick 10 rows
Expand Down
18 changes: 10 additions & 8 deletions tests/zerodist.Rout.save
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

R version 4.3.1 (2023-06-16) -- "Beagle Scouts"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Expand All @@ -16,6 +16,8 @@ Type 'demo()' for some demos, 'help()' for on-line help, or
Type 'q()' to quit R.

> options("rgdal_show_exportToProj4_warnings"="none")
> source("utils/print.R")
>
> library(sp)
> data(meuse)
> # pick 10 rows
Expand Down Expand Up @@ -65,15 +67,15 @@ Data attributes:
Mean : 8.165 Mean :0.24002 Mean : 7.478
3rd Qu.: 8.955 3rd Qu.:0.36407 3rd Qu.: 9.000
Max. :10.520 Max. :0.88039 Max. :17.000
NA's :2
NAs :2
landuse dist.m
W :50 Min. : 10.0
Ah :39 1st Qu.: 80.0
Am :22 Median : 270.0
Fw :10 Mean : 290.3
Ab : 8 3rd Qu.: 450.0
(Other):25 Max. :1000.0
NA's : 1
NAs : 1
> meusedup3 <- subset(meusedup, !(1:nrow(meusedup) %in% zd[,2]))
> print(summary(meusedup3))
Object of class SpatialPointsDataFrame
Expand All @@ -100,15 +102,15 @@ Data attributes:
Mean : 8.165 Mean :0.24002 Mean : 7.478
3rd Qu.: 8.955 3rd Qu.:0.36407 3rd Qu.: 9.000
Max. :10.520 Max. :0.88039 Max. :17.000
NA's :2
NAs :2
landuse dist.m
W :50 Min. : 10.0
Ah :39 1st Qu.: 80.0
Am :22 Median : 270.0
Fw :10 Mean : 290.3
Ab : 8 3rd Qu.: 450.0
(Other):25 Max. :1000.0
NA's : 1
NAs : 1
> dim(meuse)
[1] 155 14
> dim(meusedup2)
Expand All @@ -120,4 +122,4 @@ Data attributes:
>
> proc.time()
user system elapsed
0.544 0.048 0.586
0.257 0.044 0.291