1

I am using padr 0.3.0 to pad out any missing timestamps for server statistics and it works great. I am currently only padding by timestamp.

My question is if I want to pad by "timestamp" and another field I'll call "diskname", can I do that the same time?

For the sake of argument, lets say there are 3 disks per time interval. Can padr do that?

timestamp, diskname, X.Busy

2017-10-07 22:01:00, dm-0,11

2017-10-07 22:01:00, dm-1, 5

2017-10-07 22:01:00, dm-2,20

2017-10-07 22:02:00, dm-0,11

2017-10-07 22:02:00, dm-1,6

2017-10-07 22:02:00, dm-2,20

...Padding occurs here...

2017-10-07 22:05:00, dm-0,12

2017-10-07 22:05:00, dm-1,5

2017-10-07 22:05:00, dm-2,19

Any advise is greatly appreciated. Thanks for creating padr, it really helps in my current implementation padding missing timestamps.

Lou Gallo

Louis.G.A.Gallo@gmail.com

www
  • 38,575
  • 12
  • 48
  • 84

1 Answers1

0

Seems you are looking for pad(group =...)

library(dplyr)
library(padr)
#Let's say df has the above sample data
df %>% pad(group = 'diskname') %>% arrange(timestamp, diskname)


Hope this helps!

Prem
  • 11,775
  • 1
  • 19
  • 33