Learn R Programming

GDELTtools (version 1.2)

NormEventCounts: Scale event counts

Description

Scale event counts based on the unit of analysis.

Usage

NormEventCounts(x, unit.analysis, var.name = "norming_vars")

Arguments

x

data.frame, a GDELT data.frame.

unit.analysis

character, default is country.day; other options: country.day, country.month, country.year, day, month, year

var.name

character, base name for the new count variables

Value

data.frame

Details

For unit.analysis, day and country-day put out a data set where date is of class ‘date’. All other options put out a data set where year or month is integer (this needs to be unified in a later version).

References

GDELT: Global Data on Events, Location and Tone, 1979-2012. Presented at the 2013 meeting of the International Studies Association in San Francisco, CA. http://www.gdeltproject.org/

Examples

Run this code
# NOT RUN {
GDELT.subset.data <- GetGDELT("2013-06-01", "2013-06-07", allow.wildcards=TRUE,
  filter=list(ActionGeo_CountryCode=c("AF", "US"), EventCode="14*"),
  local.folder="~/gdeltdata")
GDELT.normed.data <- NormEventCounts(x = GDELT.subset.data,
  unit.analysis="day",
  var.name="protest")
# }

Run the code above in your browser using DataLab