mergeCompustat: Connect sentiment count of multiple cik's 10-K filing with...

Description Usage Arguments Details Value Examples

View source: R/mergeCompustat.R

Description

mergeCompustat merge sentiment count of 10-K filing with Compustat data.

Usage

1
mergeCompustat (cik.no, filing.yr, words.list, compustat.data)

Arguments

cik.no

cik number.

filing.yr

10-K filing year.

words.list

sentiment dictionary in list format.

compustat.data

Compustat dataframe.

Details

mergeCompustat function takes cik number, filing year, sentiment dictionary, and Compustat data. It downloads 10-K filings for desired cik and filing year present in an input Compustat dataset in new directory "Edgar filings/Compustat filings". The function also counts sentiment words from 10-K's and append those counts with new column named "sentiment.count" to Compustat dataframe. Working directory must contain 'Master Index' directory which contains master Rda files for specified filing year. This master index can be downloaded using getMasterIndex function. Please note that Compustat data must contains 'cik' column, and 'datadate' column in 'mm/dd/yyyy' format.

Value

Compustat data with sentiment.count column for desired cik and filing year.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 

## User needs to input Compustat data in dataframe format.
compustat.data <- read.csv('compustat_data.csv')

## User can apply any desired user defined dictionary 
## other than default dictionaries from this package.
words.list <- scan(system.file('data/negwords.txt', package = 'edgar') 
                   , what='character')

## For single cik
res <- mergeCompustat( 2098, 2014, words.list, compustat.data)

## User can provide list of different CIK's.
cik.no <- c(1750,6201,2098)
res <- mergeCompustat( cik.no, 2014, words.list, compustat.data)
 

## End(Not run)

edgar documentation built on June 4, 2017, 9:45 p.m.

Related to mergeCompustat in edgar...