[R] help with algorithm

John Sorkin JSorkin at grecc.umaryland.edu
Sun Jul 31 23:55:35 CEST 2011


I can help with a few questions:
Q) How to get means for "by" groups and subset a files based on those (subset
highest and lowest groups)?  (I can do this in multiple steps* but wonder
what the best, "R way" is to do this.)
A) aggregate

Q) How to create a matrix of plots?  (Take 4 separate plots and put them into a
single graphic.)
A) I am not sure exactly what you want to do. The mfcol or mfrow parameter of the par function might do what you want. The coplot function might also. 

John


John David Sorkin M.D., Ph.D.
Chief, Biostatistics and Informatics
University of Maryland School of Medicine Division of Gerontology
Baltimore VA Medical Center
10 North Greene Street
GRECC (BT/18/GR)
Baltimore, MD 21201-1524
(Phone) 410-605-7119
(Fax) 410-605-7913 (Please call phone number above prior to faxing)

>>> r student <studentofr at gmail.com> 7/31/2011 1:57 PM >>>
I'm wondering if anyone can give some basic advice about how to approach a
specific task in R.

I'm new to R but have used SAS for many years, and while I can muscle
through a lot of the code details, I'm unsure of a few things.


Specific questions:

If I have to perform a set of actions on a group of files, should I use a
loop (I feel like I've heard people say to avoid looping in R)?

How to get means for "by" groups and subset a files based on those (subset
highest and lowest groups)?  (I can do this in multiple steps* but wonder
what the best, "R way" is to do this.)

How to draw cutoff lines at specific points on density plots?

How to create a matrix of plots?  (Take 4 separate plots and put them into a
single graphic.)


* Get group means, add means back to file, sort by mean, take first and last
groups



Feel free to excoriate me if I'm asking for too much help.  If possible
though, a few words of advice (loops are the best way, just use the "main"
parameter to combine plots) would be lovely if you can provide.



Thanks!

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

Confidentiality Statement:
This email message, including any attachments, is for th...{{dropped:6}}



More information about the R-help mailing list