cshp: Access the CShapes dataset in R

Description Usage Arguments Value Author(s) See Also Examples

View source: R/cshp.R

Description

The cshp function makes the cshapes dataset available for usage in R. If no date is given, it returns a SpatialPolygonsDataFrame with the complete CShapes dataset. If specified, the date is used to create a snapshot of the dataset, containing all cshapes polygons active at the given date.

Usage

1
  cshp(date=NA, useGW=TRUE)

Arguments

date

The date for which the cshapes polygons should be extracted. This argument must be of type Date and must be in the range 1/1/1946 - 30/6/2012. If omitted, the complete dataset is returned.

useGW

Boolean argument specifying the system membership coding. TRUE (Default): Gleditsch and Ward (1999). FALSE: Correlates of War.

Value

A SpatialPolygonsDataFrame, containing the complete CShapes dataset, or the CShapes snapshot for the specified date.

Author(s)

Nils B. Weidmann

See Also

SpatialPolygonsDataFrame

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Retrieve the dataset
cshp.data <- cshp()

# Get summary statistics
summary(cshp.data)

# Extract Switzerland 
switzerland <- cshp.data[cshp.data$COWCODE==225,]

# Plot Switzerland
plot(switzerland)

# Extract a snapshot of cshapes as of June 30, 2002
# using the Gleditsch&Ward coding system
cshp.2002 <- cshp(date=as.Date("2002-6-30"), useGW=TRUE)

cshapes documentation built on May 31, 2017, 2:29 a.m.