Ok, thanks for the heads up. I'll make sure I'm home in time to take him to the game and give you a bit of a break.
-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

Kenneth Rose <kennethrose82@gmail.com> wrote:

Hi guys, I'm a complete newbie so I'm not sure if my question is stupid. But anyway, I can't figure it out! I'm trying to do calculate returns in "TTR" and "PerformanceAnalytics" (inspired by this<http://www.milktrader.net/2011/04/chop-slice-and-dice-your-returns-in-r.html>article from milktrader) but I get the error below whenever I run the code: * "Error in inherits(x, "xts") : trying to get slot "Luk" from an object (class "data.frame") that is not an S4 object" * I have downloaded data from another source then to ones possible in PerformanceAnalytics because Yahoos dataset is incomplete. The dataset I have downloaded is not complete either but at least there are closing prices for the whole period. The dataset variables are in danish but can be translated as: Dato = Date �bning = Open (or opening price) H�j = High Lav = Low Luk = Close (or closing price) Oms�tning = Volume This is the code: require("quantmod") require("TTR") require("PerformanceAnalytics") danske <-
read.table(" http://www.euroinvestor.dk/HistoricalQuotes/HistoricalQuotes.aspx?lang=DA&fn=DANSKE&outputmode=5&format=csv&separator=,&lcid=2057&stockid=235240", sep = ",", header = TRUE) danske@logreturns <- PerformanceAnalytics::Return.calculate(danske@Luk) danske@ROC <- TTR::ROC(danske@Luk) I appreciate your help! Yours sincerely, Kenneth 	[[alternative HTML version deleted]]_____________________________________________
R-SIG-Finance@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.


	[[alternative HTML version deleted]]

