This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
key <- 'bZW0wu4jbqMrkzHhapw8E9...' # use your API key here | |
t0 <- ISOdate(2012, 05, 23, hour=19, tz="America/Los_Angeles") | |
z <- getDatapoints(58785, 'large', key, start=t0, interval=30, duration='12hours') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
key <- 'bZW0wu4jbqMrkzHhapw8E9...' # use your API key here | |
t0 <- ISOdate(2012, 05, 23, hour=19, tz="America/Los_Angeles") | |
z <- getDatapoints(58785, 'large', key, start=t0, interval=30, duration='12hours') | |
plot(z) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
key <- 'bZW0wu4jbqMrkzHhapw8E9...' # use your API key here | |
t0 <- ISOdate(2012, 05, 23, hour=19, tz="America/Los_Angeles") | |
z <- getDatapoints(58785, 'large', key, start=t0, interval=30, duration='12hours') | |
plot(z) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(pachube) | |
key <- 'bZW0wu4jbqMrkzHhapw8E9...' # use your API key here | |
t0 <- ISOdate(2012, 05, 23, hour=19, tz="America/Los_Angeles") | |
z <- getDatapoints(58785, 'large', key, start=t0, interval=30, duration='12hours') | |
plot(z) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(cosm) | |
key <- 'bZW0wu4jbqMrkzHhap...' # your API key here | |
z <- feed_history(58785, key, duration='3hours') | |
plot(z) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(ggplot2) | |
require(proto) | |
StatRollApplyR <- proto(ggplot2:::Stat, { | |
required_aes <- c("x", "y") | |
default_geom <- function(.) GeomLine | |
objname <- "rollapplyr" | |
calculate_groups <- function(., data, scales, ...) { | |
.super$calculate_groups(., data, scales, ...) | |
} | |
calculate <- function(., data, scales, width, FUN, fill=NA, ...) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('cosm') | |
if (!exists('key')) key <- readline('API key: ') | |
feed <- getFeed(58537, key) | |
print(feed$description) | |
t0 <- Sys.time() | |
duration <- 60 * 60 * 24 * 7 # one week | |
z <- getDatapoints(feed, key, datastreams='2h', end=t0, start=t0-duration) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' read.serlog | |
#' | |
#' Read CSV records from a file written by serlog.py | |
#' | |
#' @param file filename | |
#' @param varnames column names for the resulting \link{zoo} object | |
#' @export | |
read.serlog <- function(file, varnames) { | |
require(zoo) | |
options(digits.secs=3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Join the wireless network | |
set wlan ssid WIFI_NETWORK | |
set wlan phrase WIFI_PASSWORD | |
set wlan join 1 | |
join | |
// Set the real-time clock | |
set time | |
show time | |
set time enable 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Repositories | |
options(repos = c( | |
CRAN = 'http://cran.cnr.Berkeley.edu', | |
CRANExtra = 'http://www.stats.ox.ac.uk/pub/RWin/' | |
) | |
) | |
# Millisecond precision with POSIXt objects, strptime(), etc. | |
options(digits.secs=3) |
OlderNewer