[R] array elements incorrect

Moshe Olshansky m_olshansky at yahoo.com
Wed Jun 18 00:44:47 CEST 2008


If ind is the vector of rows of dat you are interested in then dat[ind,] is what you need.


--- On Wed, 18/6/08, Paul Adams <pma3622 at yahoo.com> wrote:

> From: Paul Adams <pma3622 at yahoo.com>
> Subject: [R] array elements incorrect
> To: r-help at r-project.org
> Received: Wednesday, 18 June, 2008, 8:23 AM
> Hello everyone,
> I have a question as to what code should be used if 
> one wanted to subset from a dataframe of 7000rows by 38
> columns.For example if you wanted to generate a array of 
> 100 by 38 would you not use the following:
> Z<-(dat,dim=c(100,38))
> where dat is the dataframe of 7000by 38
> Whenever I do this and type show(Z) I get a output of 100
> by 38
> they all say "integer,7000" as every element of
> the array.I do not 
> understand what is wrong as the printout should have
> the values from 
> the dat file.?
> Any help would be appreciated
> Paul
> 
> 
>       
> 	[[alternative HTML version
> deleted]]______________________________________________
> R-help at 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.



More information about the R-help mailing list