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

Description Usage Arguments Details Value Examples

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 data frame.

Details

mergeCompustat function takes cik number, filing year, sentiment dictionary, and Compustat data. It download and parse 10-K filing for desired cik and filing year present in input Compustat dataset. It count sentiment words present in defined 10-K and append to Compustat data frame. 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 data frame 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)


Search within the edgar package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.