Skip to content

Commit da26644

Browse files
author
hornik
committed
Do no lose names.
git-svn-id: https://svn.r-project.org/R/trunk@87600 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent d05f01d commit da26644

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/library/base/R/datetime.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,10 +771,12 @@ as.data.frame.difftime <- as.data.frame.vector
771771

772772
format.difftime <- function(x,...)
773773
{
774-
if(length(x))
774+
y <- if(length(x))
775775
paste(format(unclass(x),...), units(x))
776776
else
777777
character()
778+
names(y) <- names(x)
779+
y
778780
}
779781

780782
print.difftime <- function(x, digits = getOption("digits"), ...)

0 commit comments

Comments
 (0)