Skip to content

Commit

Permalink
Merge pull request #37 from tbeason/revisions
Browse files Browse the repository at this point in the history
CSV missingstring, documentation, compat updates
  • Loading branch information
tbeason authored Dec 21, 2021
2 parents b524cc4 + 708f334 commit 53b5ba0
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "FamaFrenchData"
uuid = "bd2a388e-9788-4ef7-9fc3-f4c919ffde82"
authors = ["Tyler Beason <[email protected]>"]
version = "0.4.1"
version = "0.4.2"

[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Expand All @@ -13,7 +13,7 @@ ZipFile = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea"
[compat]
CSV = "^0.7.6, 0.8, 0.9"
DataFrames = "0.19.4, 0.20, 0.21, 0.22, 1"
Downloads = "1.4, 1.5"
Downloads = "1.4, 1.5, 1.6"
ZipFile = "0.8.4, 0.9"
julia = "^1.3"

Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,19 @@ The Fama-French 3 factor model is a commonly used empirical asset pricing model.
```julia
using FamaFrenchData, DataFrames

# read the Fama-French 3 factors (monthly and annual)
tables, tablenotes, filenotes = readFamaFrench("F-F_Research_Data_Factors")

FF3_monthly = tables[1]
FF3_annual = tables[2]

# read the Fama-French 3 factors (daily)
tablesd, tablenotesd, filenotesd = readFamaFrench("F-F_Research_Data_Factors_Daily")
FF3_daily = tables[1]

# read the 25 Size-B/M portfolios (monthly and annual)
tables25, tablenotes25, filenotes25 = readFamaFrench("25_Portfolios_5x5")
FF_ME_BM_25 = tables25[1]
```


Expand Down
19 changes: 17 additions & 2 deletions src/FamaFrenchData.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,24 @@ Returns three pieces:
- `tables::Vector{DataFrame}` - the extracted tables
- `tablenotes::Vector{String}` - any notes to the
- `tablenotes::Vector{String}` - any notes to the tables
- `filenotes::String` - notes at the top of the file
Example Usage:
```julia
using DataFrames, FamaFrenchData
# read the Fama-French 3 factors (monthly and annual)
tables, tablenotes, filenotes = readFamaFrench("F-F_Research_Data_Factors")
# read the Fama-French 3 factors (daily)
tablesd, tablenotesd, filenotesd = readFamaFrench("F-F_Research_Data_Factors_Daily")
# read the 25 Size-B/M portfolios (monthly and annual)
tables25, tablenotes25, filenotes25 = readFamaFrench("25_Portfolios_5x5")
```
"""
function readFamaFrench(ffn;kwargs...)
if !isfile(ffn)
Expand Down Expand Up @@ -125,7 +140,7 @@ Returns three pieces:
- `filenotes::String` - notes at the top of the file
"""
function parsefile(lines;kwargs...)
csvopt = (missingstrings = ["-99.99","-999"],normalizenames = false,kwargs...)
csvopt = (missingstring = ["-99.99","-999"],normalizenames = false,kwargs...)

stringarray = readlines(lines,keep=true)
striparray = strip.(stringarray)
Expand Down

2 comments on commit 53b5ba0

@tbeason
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register

Release notes:

compat updates
CSV missingstring kwarg fixed
slightly better docs

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/50973

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.4.2 -m "<description of version>" 53b5ba0aed3c0393efb3f080c0ab1c3921b6e2b6
git push origin v0.4.2

Please sign in to comment.