Skip to content

Commit de0767d

Browse files
author
Lindsay Carr
committed
replace if else w/ append_keepclass
1 parent ac12b3c commit de0767d

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

R/utils-list.R

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,7 @@ strip_pts <- function(list, param){
3434
for (v in param){
3535
if (v %in% names(list) && !inherits(list[[v]], c('function','formula'))) {
3636
v.vals <- list[[v]]
37-
# append to out without losing timezones when it is a date/POSIX
38-
if(is.null(out)){
39-
out <- v.vals
40-
} else {
41-
out <- append(out, v.vals)
42-
}
37+
out <- append_keepclass(out, v.vals)
4338
out.class <- ifelse(!all(is.na(v.vals)), class(v.vals), out.class)
4439
} else {
4540
if (any(sapply(list, is.list))){

0 commit comments

Comments
 (0)