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]]

