Skip to content

Commit

Permalink
doc and require file updated
Browse files Browse the repository at this point in the history
  • Loading branch information
cgroll committed Oct 10, 2014
1 parent f4ceaf8 commit 22d67e8
Show file tree
Hide file tree
Showing 4 changed files with 127 additions and 27 deletions.
9 changes: 5 additions & 4 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
julia 0.3-
julia 0.4-
DataArrays 0.2-
DataFrames 0.5.4-
Dates 0.3.1-
DataFrames 0.5.10-
Dates 0.4.1-
Gumbo 0.1.0-
TimeSeries 0.4.3-
TimeData 0.3.2-
TimeData 0.4.0-
99 changes: 86 additions & 13 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
pre.src-sql:before { content: 'SQL'; }

table { border-collapse:collapse; }
caption.t-above { caption-side: top; }
caption.t-bottom { caption-side: bottom; }
td, th { vertical-align:top; }
th.right { text-align: center; }
th.left { text-align: center; }
Expand Down Expand Up @@ -122,7 +124,7 @@ <h2>EconDatasets package for Julia language</h2>
@licstart The following is the entire license notice for the
JavaScript code in this tag.
Copyright (C) 2012 Free Software Foundation, Inc.
Copyright (C) 2012-2013 Free Software Foundation, Inc.
The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
Expand Down Expand Up @@ -172,8 +174,9 @@ <h2>Table of Contents</h2>
<ul>
<li><a href="#sec-1">1. Motivation</a></li>
<li><a href="#sec-2">2. Table of data sets</a></li>
<li><a href="#sec-3">3. Table of functions to interactively download data</a></li>
<li><a href="#sec-4">4. Acknowledgement</a></li>
<li><a href="#sec-3">3. Data sets to be downloaded first</a></li>
<li><a href="#sec-4">4. Table of functions to interactively download data</a></li>
<li><a href="#sec-5">5. Acknowledgement</a></li>
</ul>
</div>
</div>
Expand Down Expand Up @@ -215,7 +218,7 @@ <h2 id="sec-1"><span class="section-number-2">1</span> Motivation</h2>
</p>
<div class="org-src-container">

<pre class="src src-julia">getDataset("SP500")
<pre class="src src-julia">getDataset("FFF") # Fama French factors
</pre>
</div>

Expand All @@ -229,6 +232,7 @@ <h2 id="sec-1"><span class="section-number-2">1</span> Motivation</h2>
</div>
</div>


<div id="outline-container-sec-2" class="outline-2">
<h2 id="sec-2"><span class="section-number-2">2</span> Table of data sets</h2>
<div class="outline-text-2" id="text-2">
Expand All @@ -253,16 +257,72 @@ <h2 id="sec-2"><span class="section-number-2">2</span> Table of data sets</h2>
</tr>

<tr>
<td class="left">&#xa0;</td>
<td class="left">&#xa0;</td>
<td class="left">SP500</td>
<td class="left">Stock price data for SP500 components</td>
</tr>

<tr>
<td class="left">UMD</td>
<td class="left">Fama French momentum portfolio</td>
</tr>

<tr>
<td class="left">FFF</td>
<td class="left">Fama French factors</td>
</tr>

<tr>
<td class="left">SP500Ticker</td>
<td class="left">SP500 ticker symbols from Wikipedia</td>
</tr>
</tbody>
</table>
</div>
</div>

<div id="outline-container-sec-3" class="outline-2">
<h2 id="sec-3"><span class="section-number-2">3</span> Table of functions to interactively download data</h2>
<h2 id="sec-3"><span class="section-number-2">3</span> Data sets to be downloaded first</h2>
<div class="outline-text-2" id="text-3">
<p>
The following data sets do not ship with the package, as they may not
be re-distributed. Hence, they need to be downloaded first. This can
be done with function <code>getDataset</code>. Some of these data sets will call
a script and not a function, so they will create some variables in
your workspace. Also, if running the scripts through the high level
function <code>getDataset</code> causes an error, it still might work if you run
the script with <code>include</code>:
</p>

<div class="org-src-container">

<pre class="src src-julia">include(joinpath(Pkg.dir("EconDatasets"), "src/getDataset/", "getSP500.jl"))
</pre>
</div>

<ul class="org-ul">
<li>Data sets downloaded by functions
<ul class="org-ul">
<li>FFF
</li>
<li>UMD
</li>
</ul>
</li>
<li>Data sets downloaded by scripts
<ul class="org-ul">
<li>SP500
</li>
<li>SP500Ticker
</li>
</ul>
</li>
</ul>
</div>
</div>

<div id="outline-container-sec-4" class="outline-2">
<h2 id="sec-4"><span class="section-number-2">4</span> Table of functions to interactively download data</h2>
<div class="outline-text-2" id="text-4">
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">


Expand All @@ -287,16 +347,29 @@ <h2 id="sec-3"><span class="section-number-2">3</span> Table of functions to int
<td class="left"><code>readFamaFrenchRaw</code></td>
<td class="left">see <a href="http://nbviewer.ipython.org/github/JuliaFinMetriX/EconDatasets.jl/blob/master/ijulia/readFamaFrenchRaw.ipynb">ijulia example</a></td>
</tr>

<tr>
<td class="left"><code>readYahooFinance</code></td>
<td class="left">see <a href="http://grollchristian.wordpress.com/2014/09/05/sp500-data-download-julia/">blog post</a></td>
</tr>

<tr>
<td class="left"><code>readYahooAdjClose</code></td>
<td class="left">see <a href="http://grollchristian.wordpress.com/2014/09/05/sp500-data-download-julia/">blog post</a></td>
</tr>

<tr>
<td class="left"><code>getAdjClose</code></td>
<td class="left">&#xa0;</td>
</tr>
</tbody>
</table>
</div>
</div>



<div id="outline-container-sec-4" class="outline-2">
<h2 id="sec-4"><span class="section-number-2">4</span> Acknowledgement</h2>
<div class="outline-text-2" id="text-4">
<div id="outline-container-sec-5" class="outline-2">
<h2 id="sec-5"><span class="section-number-2">5</span> Acknowledgement</h2>
<div class="outline-text-2" id="text-5">
<p>
Of course, any package can only be as good as the individual parts
that it builds on. Accordingly, I'd like to thank all people that
Expand Down Expand Up @@ -329,7 +402,7 @@ <h2 id="sec-4"><span class="section-number-2">4</span> Acknowledgement</h2>
</div>
</div>
<div id="postamble" class="status">
<p class="creator"><a href="http://www.gnu.org/software/emacs/">Emacs</a> 23.3.1 (<a href="http://orgmode.org">Org</a> mode 8.2.1)</p>
<p class="creator"><a href="http://www.gnu.org/software/emacs/">Emacs</a> 24.3.1 (<a href="http://orgmode.org">Org</a> mode 8.2.7)</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>
Expand Down
40 changes: 32 additions & 8 deletions index.org
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ In order to download a given data set, one needs to use call function
directory of the package, making it accessible for future use with
function ~dataset~.
#+BEGIN_SRC julia
getDataset("SP500")
getDataset("FFF") # Fama French factors
#+END_SRC

In addition, there also exist functions that directly load data into
Expand All @@ -108,20 +108,44 @@ adequately.

* Table of data sets

| Name | Description |
|---------+------------------------------------------|
| Sectors | Sector affiliations for SP500 components |
| | |
| Name | Description |
|-------------+------------------------------------------|
| Sectors | Sector affiliations for SP500 components |
| SP500 | Stock price data for SP500 components |
| UMD | Fama French momentum portfolio |
| FFF | Fama French factors |
| SP500Ticker | SP500 ticker symbols from Wikipedia |

* Data sets to be downloaded first

The following data sets do not ship with the package, as they may not
be re-distributed. Hence, they need to be downloaded first. This can
be done with function ~getDataset~. Some of these data sets will call
a script and not a function, so they will create some variables in
your workspace. Also, if running the scripts through the high level
function ~getDataset~ causes an error, it still might work if you run
the script with ~include~:

#+BEGIN_SRC julia
include(joinpath(Pkg.dir("EconDatasets"), "src/getDataset/", "getSP500.jl"))
#+END_SRC

- Data sets downloaded by functions
- FFF
- UMD
- Data sets downloaded by scripts
- SP500
- SP500Ticker

* Table of functions to interactively download data

| Name | Description |
|---------------------+--------------------|
| ~readFamaFrench~ | |
| ~readFamaFrenchRaw~ | see [[http://nbviewer.ipython.org/github/JuliaFinMetriX/EconDatasets.jl/blob/master/ijulia/readFamaFrenchRaw.ipynb][ijulia example]] |



| ~readYahooFinance~ | see [[http://grollchristian.wordpress.com/2014/09/05/sp500-data-download-julia/][blog post]] |
| ~readYahooAdjClose~ | see [[http://grollchristian.wordpress.com/2014/09/05/sp500-data-download-julia/][blog post]] |
| ~getAdjClose~ | |

* Acknowledgement

Expand Down
6 changes: 4 additions & 2 deletions src/dataset.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ function dataset(dataset_name::String)
fileDict = ["SP500" => "SP500.csv",
"Sectors" => "sectorAffiliation.csv",
"UMD" => "UMD.csv",
"FFF" => "FFF.csv"
"FFF" => "FFF.csv",
"SP500Ticker" => "SP500TickerSymbols.csv"
]

## get filename
Expand All @@ -15,7 +16,8 @@ function dataset(dataset_name::String)
cmdDict = ["SP500" => :(readTimedata($filename)),
"Sectors" => :(readtable($filename , separator = ' ')),
"UMD" => :(readTimedata($filename)),
"FFF" => :(readTimedata($filename))
"FFF" => :(readTimedata($filename)),
"SP500Ticker" => :(readcsv($filename))
]

cmd = cmdDict[dataset_name]
Expand Down

0 comments on commit 22d67e8

Please sign in to comment.