Re: [R] How to obtain a sequence of dates consisting of only weekdays

2008-09-11 Thread Weiyang Lim
September 2008 20:09 To: Weiyang Lim Cc: r-help@r-project.org Subject: Re: [R] How to obtain a sequence of dates consisting of only weekdays See ?is.holiday in chron, e.g. library(chron) s <- seq(from = chron("12/17/2007"), to = chron("8/25/2008")) s.weekday <- s[!is.holiday(s

[R] How to obtain a sequence of dates consisting of only weekdays

2008-09-11 Thread Weiyang Lim
Dear R-users, How do I obtain a sequence of dates consisting of only weekdays without the weekends in R? In S, I can do the following: timeSeq(from="12/17/2007", to="8/25/2008", by="weekdays") I tried using looking at timeSequence (fSeries package) and seq.Date (base package) but I do not kno

[R] Any function to calculate returns

2008-09-04 Thread Weiyang Lim
Hi, Sorry if this may be a simple question. Is there any function to calculate returns (percentage or non-percentage) directly like the function getReturns() in S Finmetrics? Thanks. Best Regards, wy ** The information provided in this

Re: [R] text file imported incorrectly

2008-09-04 Thread Weiyang Lim
al Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: 04 September 2008 15:43 To: Weiyang Lim Cc: r-help@r-project.org Subject: Re: [R] text file imported incorrectly Please do read the help page (as you were asked to do before posting). See the 'quote' argument. This is al

[R] text file imported incorrectly

2008-09-04 Thread Weiyang Lim
Dear R-users, When I tried to import a text file (tab delimited) which has 2000+ rows with the following command (With the importData in S, it works though), x <- read.table(textfile, sep= "\t", skip=5, stringAsFactors=F) I received the following warning message: Error in scan(file, what, nmax,