Re: [R] Sorting Numeric and Character Data

2005-10-22 Thread Thomas Hopper
Thank you; that did it! Regards, Tom On Oct 21, 2005, at 10:46 PM, Gabor Grothendieck wrote: Use read.table(myfile, header = TRUE, as.is = TRUE) where as.is=TRUE causes read.table not to convert character data to factors. On 10/21/05, Thomas Hopper [EMAIL PROTECTED] wrote: Hello, I

[R] Sorting Numeric and Character Data

2005-10-21 Thread Thomas Hopper
Hello, I have what seems like an easy question to answer, but I'm struggling with it. I have a set of categorical data that I am reading in, looking something like: category result A .234 B .123 C .564 D -.452 E .112 F -.106 I'd like to plot this twice on two separate dot charts, once with

[R] Generating Interaction Factors (combinations of Data Frame columns)

2005-03-20 Thread Thomas Hopper
I'm starting to do a fair amount of DOE in my day job and need to generate full- and fractional-factorial designs. One of the things I'd like to do is generate all possible interaction effects, given the main effects. I've been searching through the documentation, packages and mail list

Re: [R] Curious Behavior with Curve() and dnorm()

2005-02-11 Thread Thomas Hopper
set from sd(). Having identified this seeming quirk, it's not a problem for my work; it just seems inconsistent and I'm having trouble understanding it. Thanks, Tom Peter Dalgaard wrote: Thomas Hopper [EMAIL PROTECTED] writes: I am attempting to wrap the histogram function in my own custom

[R] Curious Behavior with Curve() and dnorm()

2005-02-10 Thread Thomas Hopper
I am attempting to wrap the histogram function in my own custom function, so that I can quickly generate some standard plots. A part of what I want to do is to draw a normal curve over the histogram: x - rnorm(1000) hist(x, freq=F) curve(dnorm(x), lty=3, add=T) (for normal use, x would be a

[R] Histogram Bar Spacing or Border Width

2005-02-09 Thread Thomas Hopper
Is there any way to control the spacing between bars in a histogram, or change the border width (I'm assuming the hist() function, though alternatives are welcome)? I'm interested in changing the visual spacing between columns in a plotted histogram. The general effect I'm looking for can be

Re: [R] Histogram Bar Spacing or Border Width

2005-02-09 Thread Thomas Hopper
(at least as defined in the Encyclopedia of Statistics Sciences, if not in many US Universities). It is an area, not a series of unrelated bars, so it makes no sense to have spaces between the subareas. Unfortunately, hist() will also produce barplots of counts. On Wed, 9 Feb 2005, Thomas

Re: [R] Histogram Bar Spacing or Border Width

2005-02-09 Thread Thomas Hopper
barplot values. If you have groups of bars that you want together, with spaces between the groups, you have to put 0's for each of the unspaced bars. Hope this helps, Zack - Original Message - From: Thomas Hopper [EMAIL PROTECTED] Date: Wednesday, February 9, 2005 7:02 am Subject: [R

[R] Startup Files (RProfile) and R-Aqua

2005-01-30 Thread Thomas Hopper
Hello, I'm having some difficulty understanding the documentation relative to the startup files with R-Aqua 2.0.1 for Mac OS X. Specifically, I'm wondering: where does R search for the startup files (my home directory at Users:me:?); how should they be named (.RProfile will be treated by Mac

Re: [R] Calculate Mean of Column Vectors?

2005-01-11 Thread Thomas Hopper
Many helpful replies; my thanks to all of you! colMeans() or the apply() function were what I was looking for (though the looping functions will surely come in handy elsewhere). On Jan 10, 2005, at 11:03 PM, Marc Schwartz wrote: # get the column means z - colMeans(y) Best regards, Tom

[R] Calculate Mean of Column Vectors?

2005-01-10 Thread Thomas Hopper
Hello, I've got an array defined as y - rnorm(3000), dim(y) - c(3, 1000). I'd like to produce a 1000-element vector z that is the mean of the corresponding elements of y (like z[1,1] - mean(y[1,1], y[2,1], y[3,1])), but being new to R, I'm not sure how to do this for all elements at once (or,