Skip to content

Commit

Permalink
one more addition to demo
Browse files Browse the repository at this point in the history
  • Loading branch information
eddelbuettel committed Jan 9, 2017
1 parent c608d7f commit cb88eb9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions demo/nanosecondDelayExample.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,14 @@ ggplot(plotdata, aes(day, time)) + geom_violin(aes(fill=day)) + coord_flip() +
ylab("Message Time in Nanoseconds") + xlab("Weather Conditions") +
ggtitle("Nanosecond Delay", "Under Different Weather Conditions")

tfile <- tempfile(pattern="raw", fileext=".csv")
fwrite(raw, file=tfile)
cooked <- fread(tfile)
## csv files are not 'typed' so need to recover types explicitly
cooked[, `:=`(rdsent=nanotime(rdsent),
rdrecv=nanotime(rdrecv),
sdsent=nanotime(sdsent),
sdrecv=nanotime(sdrecv))]
## now saved and restrored data are identical
all.equal(raw, cooked)

0 comments on commit cb88eb9

Please sign in to comment.