Re: [R] array elements incorrect

From: Moshe Olshansky <m_olshansky_at_yahoo.com>
Date: Tue, 17 Jun 2008 15:44:47 -0700 (PDT)


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

> 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.



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. Received on Tue 17 Jun 2008 - 23:16:13 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 18 Jun 2008 - 00:31:04 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive