Home

DL Miller edited this page Nov 30, 2015 · 7 revisions
Clone this wiki locally

Welcome to the horse wiki!

This package is silly.

Here is a simple example:

# a simple example of using horse
library(horse)


# setup the OAuth stuff for Twitter
# put your twitter dev keys here, see dev.twitter.com to get some
setup_twitter_oauth(consumer_key, consumer_secret, access_token, access_secret)

# which unlucky person will be Markovified?
user <- "hadleywickham"

# grab 300 tweets (excludes retweets)
# this can take a while as it tries to wait between requests
tweets <- get_tweets(user, 300)

# build the transition matrix
my.horse <- make_horse(tweets)

# generate a tweet
neigh(my.horse)