[R-SIG-Finance] Trouble using ohlcPlot
zakdump at gmail.com
Tue Jan 6 13:37:57 CET 2009
You should use colnames() if they're columns instead of names(). Try
mts <- cbind(results$OpenPrice, results$HighPrice, results$LowPrice,
colnames(mts) <- c("Open", "High", "Low", "Close")
HTH, Michael Zak
On 06.01.2009, at 12:27, Neil Beddoe wrote:
> Sorry about the cross-posting with r-help, I've just found this list.
> I'm trying to create a time series that will work with ohlcPlot:
> results$ClosePrice),c="mts",names=c("Open", "High", "Low","Close"))
> ohlcPlot(mts) fails with: Error in if ((!is.mts(x)) || (colnames(x)
>  != "Open") || (colnames(x) != : ...
> is.mts(mts) returns true but colnames(mts) returns NULL.
> I've trawled the archive for an example of using this function to no
> avail and it's not apparent from the docs what the data needs to
> look like. Does anyone have an example of code that will work with
> this function?
> This message is intended only for the use of the person(s) to whom
> it is addressed. It may contain information which is privileged and
> confidential. Accordingly any unauthorised use is strictly
> prohibited. If you are not the intended recipient, please contact
> the sender as soon as possible.
> It is not intended as an offer or solicitation for the purchase or
> sale of any financial instrument or as an official confirmation of
> any transaction, unless specifically agreed otherwise. All market
> prices, data and other information are not warranted as to
> completeness or accuracy and are subject to change without notice.
> Any opinions or advice contained in this Internet email are subject
> to the terms and conditions expressed in any applicable governing
> Marble Bar Asset Management LLP's terms and conditions of business
> or client agreement letter. Any comments or statements made herein
> do not necessarily reflect those of Marble Bar Asset Management LLP.
> Marble Bar Asset Management LLP is regulated and authorised by the
> [[alternative HTML version deleted]]
> R-SIG-Finance at stat.math.ethz.ch mailing list
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
More information about the R-SIG-Finance