Re: [R] How to keep the same class?

2011-09-02 Thread Eduardo M. A. M.Mendes
, 2011 5:16 PM To: Eduardo M. A. M.Mendes Cc: r-help@r-project.org Subject: Re: [R] How to keep the same class? On Sep 2, 2011, at 3:05 PM, Eduardo M. A. M.Mendes wrote: > Hello > > > > Please see the example below > > > >> class(testX) > > [1] &qu

Re: [R] How to keep the same class?

2011-09-02 Thread Marc Schwartz
On Sep 2, 2011, at 3:05 PM, Eduardo M. A. M.Mendes wrote: > Hello > > > > Please see the example below > > > >> class(testX) > > [1] "matrix" > >> class(testX[1,]) > > [1] "numeric" > > > > Why not matrix? What am I missing here? Is there a way to keep the same > class? > > >

Re: [R] How to keep the same class?

2011-09-02 Thread Henrique Dallazuanna
Try this: predict(fit10,testX[1,,drop = FALSE]) On Fri, Sep 2, 2011 at 5:05 PM, Eduardo M. A. M.Mendes wrote: > Hello > > > > Please see the example below > > > >> class(testX) > > [1] "matrix" > >> class(testX[1,]) > > [1] "numeric" > > > > Why not matrix?   What am I missing here?   Is there a

[R] How to keep the same class?

2011-09-02 Thread Eduardo M. A. M.Mendes
Hello Please see the example below > class(testX) [1] "matrix" > class(testX[1,]) [1] "numeric" Why not matrix? What am I missing here? Is there a way to keep the same class? The reason for the question is that I want to implement a k-step ahead prediction for my own routi