Learn R Programming

tweet2r (version 1.1)

tspan: Exploratory point pattern analysis.

Description

This function is design to provide an exploratory point pattern analysis. Is base on spatstat package a to do a basic point pattern analysis of Homogeneous an Inhomogeneous Poisson.

Usage

tspan(geotweets,bw, cont, acontour)

Arguments

geotweets

Geotagged tweets as a SpatialPointsDataFrame or a SpatialPointsDataFrame.

bw

Bandwith for Kernel Smoothed Intensity. Note that if you are using directly geotweets coming from tweet2r and t2SpatialPointDataFrame units are degrees.

cont

FALSE by default, geotweets bounding box provide the contour. If TRUE a contour must be provided

acontour

Optional. A Spatial object with a defined bbox.

Value

tweetspphp

Simpliest Object of class "ppp" representing a point pattern dataset in the two-dimensional plane with no marks, (ppp)

hp

Homogeneous Poisson fitted point process model to an observed point pattern (ppm).

ihp

Inhomogeneous Poisson fitted point process model to an observed point pattern (ppm).

int

Computed kernel smoothed intensity function from a point pattern. (density.ppp).

Details

In order to do a wider point pattern analysis is better to use directly the spatstat package

References

Baddeley, Adrian, y Rolf Turner. <U+00AB>Spatstat: An R Package for Analyzing Spatial Point Patterns<U+00BB>. Journal of Statistical Software 12, n.<U+00BA> 6 (2005). doi:10.18637/jss.v012.i06. http://www.jstatsoft.org/v12/i06/

See Also

spatstat

Examples

Run this code
# NOT RUN {
library(sp)
library(spatstat)

#loada a SpatialPointsDataFrame
data("meuse.grid_ll")


# run function without contour
tspan(meuse.grid_ll,bw=0.0005)

#providing a contour as SpatialPointDataFrame
data("meuse.area")

#build the acontour layer 
cont<-SpatialPoints(meuse.area, proj4string = CRS("+init=epsg:28992"))
#transform to meuse.grid_ll reference system
cont<-spTransform(cont, CRS("+init=epsg:4326"))

# run function with contour
tspan(meuse.grid_ll,bw=0.0005, cont = TRUE, acontour=cont)
{
  }
# }

Run the code above in your browser using DataLab