Re: [R] Converting ts into xts and subsetting

2012-02-15 Thread P.B. Lecavalier
you for your insights! -- Philippe Baril Lecavalier On 02/15/2012 11:30 PM, Gabor Grothendieck wrote: On Wed, Feb 15, 2012 at 10:25 PM, P.B. Lecavalier wrote: Greetings, I would like to subset observations in a time series using xts, after converting from ts to xts. X=ts(1:100, frequenc

[R] Converting ts into xts and subsetting

2012-02-15 Thread P.B. Lecavalier
Greetings, I would like to subset observations in a time series using xts, after converting from ts to xts. X=ts(1:100, frequency=12, start=c(1976)) X2=as.xts(X) X2["1984"] The output: Feb 1984 98 Mar 1984 99 Apr 1984 100 What happened to January? The index is always one month off, wit

Re: [R] if/else scope

2011-11-15 Thread P.B. Lecavalier
On 11/15/2011 06:46 PM, Kevin Burton wrote: What is wrong with the following? x<- 1:2 if(x[1]> 0) { if(x[2]> 0) { print("1& 2> 0") } else {

Re: [R] Web based R-help not a list

2011-11-10 Thread P.B. Lecavalier
On 11/10/2011 02:32 PM, Cem Girit wrote: Hello David, I am terribly sorry. I could never imagine that my naive questions could offend an experienced R-user such as you so much that he would publicly declare that he is no longer going to help me in the future! Wow; I did not

Re: [R] Creating dummys in R

2011-11-10 Thread P.B. Lecavalier
Hi, Try ifelse function. samesex <- ifelse( sex==1 & sex1==1, yes=1, no=0) Cheers Philippe Baril Lecavalier On 2011-11-10 8:03 AM, "David ." wrote: > > Dear R-project! > > How do i create 1 dummy from 2 already existing dummys. To be more > precise, I want to create a dummy from a dummy calle