format.twitter.date: Converts from Twitter date format to R date format

Description Usage Arguments Author(s) Examples

Description

Converts from Twitter date format to R date format

Usage

1
2
## S3 method for class 'twitter.date'
format(datestring, format = "datetime")

Arguments

datestring

Date string in Twitter format

output

Either "date", for Date format; or "datetime" for POSIX.

Author(s)

Pablo Barbera pablo.barbera@nyu.edu

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
## connect to the Mongo database
 mongo <- mongo.create("SMAPP_HOST:PORT", db="DATABASE")
 mongo.authenticate(mongo, username="USERNAME", password="PASSWORD", db="DATABASE")
 set <- "DATABASE.COLLECTION"

## extract all tweets that mention 'occupygezi' and do a quick plot
 tweets <- extract.tweets(set, string="occupygezi", fields="created_at")

## convert dates to R format
 dates <- format.twitter.date(tweets$created_at, format="date")

## see number of tweets per day
 table(dates)

## End(Not run)

SMAPPNYU/smappR documentation built on May 9, 2019, 11:19 a.m.