On Sat, 29 Aug 2009 00:15:45 +0200 Wolfgang Polasek <wolfgang.pola...@gmail.com> wrote:
WP> > g=gretldata[1:2,] WP> > g WP> Empfang Versand Transit Inland Ausland SumS WP> 1 787844.0 1307176.6 223395.4 1474726 16199.1 3809341 WP> 2 421473.1 306445.4 448801.2 1779402 14445.6 2970567 WP> > dim(g) WP> [1] 2 6 WP> > as.vector(g) WP> Empfang Versand Transit Inland Ausland SumS WP> 1 787844.0 1307176.6 223395.4 1474726 16199.1 3809341 WP> 2 421473.1 306445.4 448801.2 1779402 14445.6 2970567 WP> > gg=matrix(as.vector(g),nrow=1,byrow=TRUE) WP> > gg WP> [,1] [,2] [,3] [,4] [,5] [,6] WP> [1,] Numeric,2 Numeric,2 Numeric,2 Numeric,2 Numeric,2 Numeric,2 WP> > WP> Help please,the docu on thids is lousy!!!. Depending on what you want which is not really clear again, you can use ?reshape or maybe also ?stack to reshape a data-frame which gretldata supposedly is. Note that with your as.vector(g) you dont create a vector as: dat1<-data.frame(x=1:3, y=5:7) v1<-as.vector(dat1) str(v1) resp. is.vector(v1) clearly shows. So you were also not "debugging" your problem. And you clearly did not have a look at the "lousy" documentation as this is shown in the example in ?as.vector, so don't blame others! Cheers Stefan ______________________________________________ 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.