[R] Rounding and printing

2009-10-29 Thread Alan Cohen
="") [1] 56.5 1.6 0.2 3.9 0.1 2.2 0.2 2.6 1.5 4.1 1.1 6.1 21.0 [1] "56.5 (100%)" "1.6 (2.8%)" "0.2 (0.4%)" "3.9 (6.9%)" "0.1 (0.2%)" "2.2 (3.9%)" [7] "0.2 (0.4%)" "2.6 (4.6%)" "1.5 (2.

[R] Drawing lines in margins

2009-07-29 Thread Alan Cohen
Hi all, Quick question: What function can I use to draw a line in the margin of a plot? segments() and lines() both stop at the margin. In case the answer depends on exactly what I'm trying to do, see below. I'm using R v. 2.8.1 on Windows XP. Cheers, Alan I'm trying to make a horizontal ba

[R] Long to wide format without time variable

2009-06-23 Thread Alan Cohen
ssor-efficient way to replicate "reshape" without a time variable. Thanks in advance for any help you can provide. A worked example and some code I've tried are below. I'm working with R v2.8.1 on Windows XP Professional. Cheers, Alan Cohen Here's what my data look like

[R] Problem with "apply"

2009-04-22 Thread Alan Cohen
h mds[200:300,], mds[250:350,] and mds[1000:1100,], only ages with 3 digits are correctly assigned - all ages <100 are returned as NA. I'm using R v 2.8.1 on Windows XP. Cheers, Alan Cohen Centre for Global Health Research, Toronto,ON > ageassign <- function(x){ + y <- NA +

[R] Weighted principal components analysis?

2009-04-03 Thread Alan Cohen
v2.8.1 on Windows XP. I've searched Help and the R site and had no luck. Thanks for any help you can provide. Cheers, Alan Cohen Centre for Global Health Research Toronto, Ontario __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listi

[R] Using apply to get group means

2009-03-31 Thread Alan Cohen
in function? Any suggestions? Also, any way to avoid the hassles with having to convert to a data frame and then again to numeric when one variable is character? Cheers, Alan Cohen __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listin

[R] Failure to subset in R v 2.8.0

2008-12-01 Thread Alan Cohen
cter(c$month)) does not help. Nor does restarting R, restarting the computer, or trying the operation on smaller subsets of c. I'd appreciate any help you an provide. Sincerely, Alan Cohen __ R-help@r-project.org mailing list https://stat.ethz.c

[R] Memory limits for large data sets

2008-11-05 Thread Alan Cohen
R for this kind of thing? Cheers, Alan Cohen Alan Cohen Post-doctoral Fellow Centre for Global Health Research 70 Richmond St. East, Suite 202A Toronto, ON M5C 1N8 Canada (416) 854-3121 (cell) (416) 864-6060 ext. 3156 (0ffice) __ R-help@r-project.org mai