This file contains hidden or 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
#' Finds the local maxima (peaks) in the given vector after smoothing the data | |
#' with a kernel density estimator. | |
#' | |
#' First, we smooth the data using kernel density estimation (KDE) with the | |
#' \code{\link{density}} function. Then, we find all the local maxima such that | |
#' the density is concave (downward). | |
#' | |
#' Effectively, we find the local maxima with a discrete analogue to a second | |
#' derivative applied to the KDE. For details, see this StackOverflow post: | |
#' \url{http://bit.ly/Zbl7LV}. |
This file contains hidden or 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
#@author Michael J Bommarito | |
#@contact [email protected] | |
#@date Feb 20, 2011 | |
#@ip Simplified BSD, (C) 2011. | |
# This is a simple example of an R script that will retrieve | |
# public tweets from a given hashtag. | |
library(RJSONIO) | |
# This function loads stored tag data to determine the current max_id. |
This file contains hidden or 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
# Illustrative use of plyr | |
# LOAD LIBRARIES REQUIRED | |
library(plyr); | |
library(XML) | |
# FIGURE OUT PATTERN OF URL FOR EACH SEASON | |
url.b1 = 'http://ca.sports.yahoo.com/nhl/stats/byposition?pos=C,RW,LW,D'; |