Description Usage Arguments Examples
These functions are used within vizlab fetchTimestamp()
methods and may be
useful within custom methods as well.
1 2 3 4 5 6 7 8 9 10 11 | urlFetcher(id, location = NA, remoteURL)
writeTimestamp(new.timestamp, viz, timestamp.mtime = NA)
updateTimestamp(viz, verbose = FALSE)
formatTimestamp(timestamp)
locateTimestampFile(id)
readTimestamp(viz)
|
id |
the viz id - should be the same as for the viz in the calling function |
location |
the fetched data file location - should be the same as for
the viz in the calling function. May be NA if you're only passing the
output to |
remoteURL |
the new URL to use for fetching the data and/or timestamp
(assuming |
new.timestamp |
the new timestamp to write to file |
viz |
a viz item (e.g., from as.viz) |
timestamp.mtime |
the timestamp to assign to the timestamp file's metadata (using Sys.setFileTime - sets the mtime=modified time property); NA leaves the metadata alone |
verbose |
logical to pass on to |
timestamp |
POSIXct timestamp to format into a character string |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## Not run:
# this custom method probably won't do what you want,
# just shows how to use the helper functions
fetchTimestamp.myfetcher <- function(viz) {
timestamp.file <- locateTimestampFile(viz$id)
old.timestamp <- readTimestamp(viz)
new.timestamp <- getOnlineTimestamp() # made-up function, not implemented
if(!file.exists(timestamp.file) || old.timestamp < new.timestamp) {
writeTimestamp(new.timestamp, viz)
}
invisible()
}
## End(Not run)
## Not run:
fetchTimestamp.myfetcher <- function(viz) {
url <- constructURLFromViz(viz)
urlLastModified(viz$id, remoteURL=url)
}
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.