diff --git a/R/sf.R b/R/sf.R index 67788c1e..4b652108 100644 --- a/R/sf.R +++ b/R/sf.R @@ -192,9 +192,10 @@ st_as_sf.stars = function(x, ..., as_points = FALSE, merge = FALSE, na.rm = TRUE else { # another exception... time as second dimension e = expand_dimensions(x) if (length(e[-ix]) == 1 && inherits(e[-ix][[1]], c("Date", "POSIXt", "PCICt"))) { - names(df) = if (length(nc) > 1) - do.call(paste, rev(expand.grid(e[-ix][[1]], names(x)))) - else + names(df) = if (length(nc) > 1) { + nm = expand.grid(e[-ix][[1]], names(x)) + paste(nm[[2]], nm[[1]], sep = ".") + } else as.character(e[-ix][[1]]) } }