Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I answered this question before he becomes a bounty. It looks like the OP find my previous answer a little bit complicated. I organized the code in a single gist <a href="https://gist.github.com/agstudy/5024781" rel="noreferrer">here</a>. you need just to download the file and source it.</p> <p>I create new function <code>extra.calendarHeat</code> which is an extension of the first one to draw hetmap of double time series.(dat,value1,value2). I addedthis new parameters:</p> <pre><code> pch.symbol : vector of symbols , defualt 15:20 cex.symbol : cex of the symbols , default = 2 col.symbol : color of symbols , default #00000044 pvalues : value of symbols </code></pre> <p>Here some examples:</p> <pre><code>## I am using same data stock &lt;- "MSFT" start.date &lt;- "2012-01-12" end.date &lt;- Sys.Date() quote &lt;- paste("http://ichart.finance.yahoo.com/table.csv?s=", stock, "&amp;a=", substr(start.date,6,7), "&amp;b=", substr(start.date, 9, 10), "&amp;c=", substr(start.date, 1,4), "&amp;d=", substr(end.date,6,7), "&amp;e=", substr(end.date, 9, 10), "&amp;f=", substr(end.date, 1,4), "&amp;g=d&amp;ignore=.csv", sep="") stock.data &lt;- read.csv(quote, as.is=TRUE) p1 &lt;- extra.calendarHeat(dates= stock.data$Date, values = stock.data$Adj.Close, pvalues = stock.data$Volume, varname="W&amp;B MSFT Adjusted Close \n Volume as no border symbol ") </code></pre> <p><img src="https://i.stack.imgur.com/mCjxp.png" alt="enter image description here"></p> <pre><code>## multiply symbols p2 &lt;- extra.calendarHeat(dates= stock.data$Date, values = stock.data$Adj.Close, pvalues = stock.data$Volume, varname="W&amp;B MSFT Adjusted Close \n black Volume as multiply symbol ", pch.symbol = c(3,4,8,9), col.symbol='black') </code></pre> <p><img src="https://i.stack.imgur.com/vQZwR.png" alt="enter image description here"></p> <pre><code>## circles symbols p3 &lt;- extra.calendarHeat(dates= stock.data$Date, values = stock.data$Adj.Close, pvalues = stock.data$Volume, varname="W&amp;B MSFT Adjusted Close \n blue Volume as circles", pch.symbol = c(1,10,13,16,18), col.symbol='blue') </code></pre> <p><img src="https://i.stack.imgur.com/RbZbJ.png" alt="enter image description here"></p> <pre><code>## triangles symbols p4 &lt;- extra.calendarHeat(dates= stock.data$Date, values = stock.data$Adj.Close, pvalues = stock.data$Volume, varname="W&amp;B MSFT Adjusted Close \n red Volume as triangles", pch.symbol = c(2,6,17,24,25), col.symbol='red') </code></pre> <p><img src="https://i.stack.imgur.com/pSdAZ.png" alt="enter image description here"></p> <pre><code>p5 &lt;- extra.calendarHeat(dates= stock.data$Date, values = stock.data$Adj.Close, varname="MSFT Adjusted Close", pch.symbol = LETTERS, col.symbol='black') </code></pre> <p><img src="https://i.stack.imgur.com/UWg4z.png" alt="enter image description here"></p> <pre><code># symbols are LETTERS p6 &lt;- extra.calendarHeat(dates= stock.data$Date, values = stock.data$Adj.Close, pvalues = stock.data$Volume, varname="MSFT Adjusted Close \n Volume as LETTERS symbols", pch.symbol = letters, color='r2b') </code></pre> <p><img src="https://i.stack.imgur.com/7Ityc.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload