Learn R Programming

tweet2r (version 1.1)

t2pgis: Set up parameters to JSON parsing and export it to a postGIS database.

Description

This function parse the JSON files (as is defined in streamR package). Once is parsed export it to a database format the timestamp column and creates to tables one with all the tweets and other only with geotagged tweets.

Usage

t2pgis(fileprefix, con, path = ".", pattern = ".json$")

Arguments

fileprefix

Setup file prefix for JSON files. If tweets have been retrieved with the tweet2r function it should be the same. Te file prefix is used to create the table name and the geotagged table which has geo as a prefix (example "geofileprefix")

con

postGIS connection parameters. For more information look at RPostgreSQL

path

A character vector to folder. see ?list.files()

pattern

Limits possible file extensions, optional as regular expression. see ?list.files()

See Also

RPostgreSQL, streamR

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
#create a postgres connection
connection <- con <- dbConnect(PostgreSQL(), host="urls host",port=5432, 
                    user="user", password="assword", dbname="pgistweets")
fileprefix="tweets"

t2pgis(fileprefix, connection)

	
# }

Run the code above in your browser using DataLab