Skip to content

Commit

Permalink
replace if else w/ append_keepclass
Browse files Browse the repository at this point in the history
  • Loading branch information
Lindsay Carr committed Nov 7, 2016
1 parent ac12b3c commit de0767d
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions R/utils-list.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ strip_pts <- function(list, param){
for (v in param){
if (v %in% names(list) && !inherits(list[[v]], c('function','formula'))) {
v.vals <- list[[v]]
# append to out without losing timezones when it is a date/POSIX
if(is.null(out)){
out <- v.vals
} else {
out <- append(out, v.vals)
}
out <- append_keepclass(out, v.vals)
out.class <- ifelse(!all(is.na(v.vals)), class(v.vals), out.class)
} else {
if (any(sapply(list, is.list))){
Expand Down

0 comments on commit de0767d

Please sign in to comment.