Skip to content

Commit a3de3df

Browse files
committed
fixes #2557
1 parent 47b476e commit a3de3df

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: sf
2-
Version: 1.0-23
2+
Version: 1.0-24
33
Title: Simple Features for R
44
Authors@R:
55
c(person(given = "Edzer",

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# version 1.0-24
2+
3+
* fix class label setting in `[.sf()`; #2557
4+
15
# version 1.0-23
26

37
* allow tests reading blosc compressed Zarr files to fail

R/sf.R

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,12 @@ st_sf = function(..., agr = NA_agr_, row.names,
378378
x[[ sf_column ]] = geom
379379
x = st_sf(x, sf_column_name = sf_column, sfc_last = FALSE)
380380
st_set_agr(x, agr[match(setdiff(names(x), sf_column), names(agr))])
381-
} else
382-
structure(x, class = setdiff(class(x), "sf"))
381+
} else {
382+
if (inherits(x, "sf"))
383+
structure(x, class = setdiff(class(x), "sf"))
384+
else
385+
x
386+
}
383387
}
384388

385389
#' @export

0 commit comments

Comments
 (0)