Grouped mean of difftime fails in data.table
问题 Preface: I have a column in a data.table of difftime values with units set to days. I am trying to create another data.table summarizing the values with dt2 <- dt[, .(AvgTime = mean(DiffTime)), by = Group] When printing the new data.table, I see values such as 1.925988e+00 days 1.143287e+00 days 1.453975e+01 days I would like to limit the decimal place values for this column only (i.e. not setting options() unless I can do this specifically for difftime values this way). When I try to do this