On Fri, Jul 3, 2009 at 6:32 PM, Ted Byers<r.ted.by...@gmail.com> wrote: > On Fri, Jul 3, 2009 at 9:05 PM, Mark Knecht<markkne...@gmail.com> wrote: >> On Fri, Jul 3, 2009 at 5:54 PM, Ted Byers<r.ted.by...@gmail.com> wrote: >>> Sorry, I should have read the read.zoo documentation before replying >>> to thank Gabor for his repsonse. >>> >>> Here is how it starts: >>> >>> "read.zoo(zoo) R Documentation >>> >>> Reading and Writing zoo Series >>> Description >>> read.zoo and write.zoo are convenience functions for reading and >>> writing "zoo" series from/to text files. They are convenience >>> interfaces to read.table and write.table, respectively. >>> >>> Usage >>> read.zoo(file, format = "", tz = "", FUN = NULL, >>> regular = FALSE, index.column = 1, aggregate = FALSE, ...)" >>> >>> Clearly this should solve both our problems. >>> >>> Cheers, >>> >>> Ted >>> >> >> Possibly but I think the big issue is the findDrawdowns function is >> looking for minus signs to signal the drawdown. I down think it's >> doing calculations from a simple equity curve. >> >> All of these functions (findDrawdowns, table.Drawdowns, etc.) all say >> they will accept a data.frame. >> >> My guess is the issue isn't so much dates, names, or anything else as >> much as making sure you have a column of percentage rise and fall >> numbers expressed like >> >> 0.03 >> 0.02 >> -0.025 >> 0.10 >> > But this is trivial. I have to read the documentation further to see > if it wants rates of return as a fraction (or percentages), or if > daily deltas will do. Either way, it is trivial to get such numbers > (in my case in the perl script I use to draw the data from my > database. > >> Even findDrawdowns(edhec[,5]) does the right thing. Copying it to R >> wasn't necessary. edhec has lots of columns. You can pick and one of >> them and get a table. >> > This is good to know as it makes some of the analyses I need to do > easier. I can create a single file with a number of series that need > to be compared WRT drawdowns, VaR, &c. > > Cheers, > > Ted >
You don't have to put it in your data/frame if you don't want. you can jsut create a variable, write the data into it and send it to the function. The function won't care. (I don't think...) After all, R wasn't in edhec. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.