Re: [R] text in boxplots

2007-09-07 Thread Greg Snow
The posting guide (a link at the bottom of every e-mail from the list) suggests including a small example of what you are trying to do. Without an example, we have to guess at what you are trying to do. I am still guessing since you still did not include an example. It appears that part of the

Re: [R] text in boxplots

2007-09-07 Thread Greg Snow
text to the margins). -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Greg Snow Sent: Friday, September 07, 2007 9:01 AM To: Yves

Re: [R] larger decimal numbers get rounded ....

2007-09-06 Thread Greg Snow
?options Look at the entry on 'digits'. Does that fix the problem? If not, give a little more detail on what you are doing. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original Message- From: [EMAIL

Re: [R] Lisp-like primitives in R

2007-09-06 Thread Greg Snow
Not all of us are familiar with lisp (I have done a little, but not enough to really understand what you are asking). If you tell us what find, member, cond, and loop do, or what functionality you are looking for, then we will have a better chance of telling you how to do the same in R. Just

Re: [R] text in boxplots

2007-09-06 Thread Greg Snow
It works for me: boxplot( split(state.x77[,'Frost'], state.region) ) text( 1:4, -5, rep('test',4), col='green' ) Show us what you tried and maybe we can be of more help, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111

Re: [R] Different behavior of mtext

2007-09-05 Thread Greg Snow
You may also want to look at the cnvrt.coords function in the TeachingDemos package. It may be a bit simpler than mixing grid and base. -Original Message- From: Sébastien [EMAIL PROTECTED] To: Prof Brian Ripley [EMAIL PROTECTED] Cc: R-help r-help@stat.math.ethz.ch Sent: 9/3/07 7:46 PM

Re: [R] How to obtain intercept statistics in anova withwithin-subject factors?

2007-09-05 Thread Greg Snow
Sorry, I did not think about the nested design (did not read carefully enough). Another thing to try (untested) is to create a column of 1's and include that specifically and exclude the default intercept, then your column of 1's acts as the intercept, but a p-value is returned from it. Note

Re: [R] element wise opertation between a vector and a list

2007-09-05 Thread Greg Snow
?mapply mapply('+', a, b, SIMPLIFY=FALSE) colSums(mapply('+', a, b)) Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On

Re: [R] rug() colors

2007-09-05 Thread Greg Snow
You could make multiple calls to the rug function using a different color for each call. Using tapply or by may automate this for you. Another option would be to create your own rug using the segments function (which will plot multiple colors). Hope this helps, -- Gregory (Greg) L. Snow Ph.D.

Re: [R] Q: selecting a name when it is known as a string

2007-09-05 Thread Greg Snow
If your main goal is to do a loess fit, then make predictions from that, then using the 'get' function may do what you want: tmp.var - get(ORDINATE) lo - loess(percent ~ ncms * tmp.var, d, ... grid - expand.grid(tmp.var=MINVAL:MAXVAL, ncms=MINCMS:MAXCMS) predict(lo, grid) Here you stick with

Re: [R] Multiple xyplots

2007-09-05 Thread Greg Snow
Take a look at the my.symbols function in the TeachingDemos package. The last example shows how to create a hexagonal grid and the 2nd to last example shows how to plot several small line plots onto a larger plot. Combining these 2 examples should give you what you want. Hope this helps, --

Re: [R] Pie Chart Labels

2007-09-04 Thread Greg Snow
The best option is to use a bar chart or dot chart instead of a pie chart. -Original Message- From: Adam Green [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch r-help@stat.math.ethz.ch Sent: 9/4/07 10:21 AM Subject: [R] Pie Chart Labels I am having trouble finding out how to adjust the

Re: [R] Automatic anchors for text boxes

2007-08-31 Thread Greg Snow
A couple of things that may help: 1. you can create your boxplots by using boxplot with plot=FALSE, then plotting that info using the bxp function. The bxp function returns the locations of the boxes as part of the output which could then be used for placing labels or refrence lines. 2. The

Re: [R] gsub warning message

2007-08-31 Thread Greg Snow
What is happening is that before the regex engine can look at your pattern, the R string parsing routines first process your input as a string. In the string processing there are certain things represented using a backslash. Try this code in R: cat('here\tthere\n') The \t is made into a tab

Re: [R] Single plot multiple levels in x?

2007-08-31 Thread Greg Snow
Try this code (with the mydf that you generate below): library(TeachingDemos) plot( c(0,5), c(0,1), xlab='State', ylab='ylab', axes=FALSE, type='n' ) axis(1, at= (1:5) - 0.5, labels=paste('state',1:5)) box() for(i in 1:5){ with( subset(mydf, State==i), subplot( plot(Position,

Re: [R] plotting

2007-08-31 Thread Greg Snow
Here is the approach that I would take. Use a different plot for each day but line them all up like so: x - c(1, 2, 10, 12) y - c(100, -20, 50, 25) day - c(1,1,2,2) my.df - data.frame(x=x,y=y,day=day) par(mfrow=c(1,2), oma=c(5,4,4,2)+0.1, mar=c(0,0,0,0)) tmp.yr - range(my.df$y) for (i in

Re: [R] Excel

2007-08-30 Thread Greg Snow
generally works better). Erich Neuwirth wrote: -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Erich Neuwirth Sent: Wednesday, August 29, 2007 4:46 PM To: r-help Subject: Re: [R] Excel Greg Snow wrote: Or do you trust all of your clients to know

Re: [R] Excel

2007-08-30 Thread Greg Snow
Matt Austin wrote: -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Austin, Matt Sent: Thursday, August 30, 2007 1:25 PM To: r-help Subject: Re: [R] Excel Ah . . . the hammer analogy. In a conversation like this it's not a question of will

Re: [R] (no subject)

2007-08-30 Thread Greg Snow
Try calling summary.lm on your object (if it is an aov object then summary calls summary.aov which does not show the intercept, but calling summary.lm directly does give info on the intercept). -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED]

Re: [R] The l1ce function in lasso2: The bound and absolute.tparameters.

2007-08-29 Thread Greg Snow
This is my understanding of what is happening. 1. Standardize all the x variables to have mean 0 and variance 1 (possibly y as well). 2. Compute the unconstrained least squares regression. 3. Sum the abs values of the b's. That sum is the scaling factor. A bound of 1 means the sum above (and

Re: [R] Excel

2007-08-29 Thread Greg Snow
Erich Neuwirth said: -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Erich Neuwirth Sent: Wednesday, August 29, 2007 12:43 PM To: r-help Subject: Re: [R] Excel Excel bashing can be fun but also can be dangerous because you are makeing your

Re: [R] a new-bie question about obtaining certain value from the printout

2007-08-29 Thread Greg Snow
You need to save the output in order to do something with it (the default if you don't save the output is to call the print method, so what you are seeing is the results of calling print.htest on the return value from t.test). Save the output by doing something like: out - t.test(c(1:5,7:11),

Re: [R] ordered factors in data.frame

2007-08-28 Thread Greg Snow
From: Birgit Lemcke [mailto:[EMAIL PROTECTED] Sent: Friday, August 24, 2007 2:13 AM To: Greg Snow Cc: R Hilfe Subject: Re: [R] ordered factors in data.frame Thanks a lot Greg for your help

Re: [R] Forcing coefficients in lm object

2007-08-28 Thread Greg Snow
The important element in the fit object is named coefficients not coef. Sometimes the partial matching can cause confusion when it tries to help. In your case it creates a copy of the coefficients, changes the 2nd value, then creates a new component to fit called coef with these values (not

Re: [R] quntile(table)?

2007-08-28 Thread Greg Snow
See the wtd.quantile function in the Hmisc package. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Seung Jun Sent: Tuesday,

Re: [R] Stacked Bar

2007-08-23 Thread Greg Snow
Deb, Others have answered your question, I just want to give you something else to think about. Stacked bar plots may not be the best tool to use for this situation, they are ok for comparing the bottom and top groups, but all the other groups don't line up in a stacked bar plot making those

Re: [R] divided scatter plots

2007-08-23 Thread Greg Snow
Does the following code do something like what you want (but with the built in data): plot(as.integer(state.region), state.x77[,'Murder'], + xaxt='n', xlim=c(0,5), col=as.integer(state.region)) axis(1, at=1:4, labels=levels(state.region)) oo - order(order( as.integer(state.region),

Re: [R] ordered factors in data.frame

2007-08-23 Thread Greg Snow
The attach function only attachs a copy of the data (changes to the data don't show up in the attached copy). Also you need to tell R what to do with the result of as.ordered (where to save it). Try something like: table$V3 - as.ordered(table$V3) Or table - transform(table,

Re: [R] several plots on several pages

2007-08-16 Thread Greg Snow
You can set up the 3 plots per page by using: par(mfrow=c(3,1)) Then there are a couple of options for skipping the top graphics position if the graph fails. If you know that the graph failed then you can just use plot.new() (or frame()) to skip the top plot and plot the next one in the 2nd

Re: [R] several plots on several pages

2007-08-16 Thread Greg Snow
Oops, I read further down in your original post and see that you already knew about par(mfg=c(2,1)). To get it to advance to page 2 for the 4th plot try calling plot.new() which should move you to the next page, then doing par(mfg=c(1,1)) should cause the next graph to be at the top. Hope this

Re: [R] Linear models over large datasets

2007-08-16 Thread Greg Snow
Here are a couple of options that you could look at: The biglm package also has the bigglm function which you only call once (no update), you just need to give it a function that reads the data in chunks for you. Using bigglm with a gaussian family is equivalent to lm. You could also write your

Re: [R] Possible to import histograms in R?

2007-08-15 Thread Greg Snow
Ted Harding wrote: [snip] So you if you want the density plot, you would need to calculate this for yourself. E.g. H1$density - counts/sum(counts) plot.histogram(H1,freq=FALSE) shouldn't that be: H1$density - counts/sum(counts)/diff(brkpts) ?

Re: [R] Problem with by: does not work with ttest (but with lme)

2007-08-14 Thread Greg Snow
I think at least part of your problem is that in the lm example you use data=x (correct), but in the t.test example you use data=warpbreaks, so in that case it is uing the full data set, not just the portion passed by the 'by' function. Try the t.test example again with data=x and see what

Re: [R] Subject: Re: how to include bar values in a barplot?

2007-08-10 Thread Greg Snow
Jim Lemon Wrote: I also greatly enjoyed Ted's rebuttal of the Bar charts are evil and must be banned argument. If bar charts are appropriate for the audience, give 'em bar charts. One great way to turn off your customers is to tell them what they can and can't do with your product. I

Re: [R] how to include bar values in a barplot?

2007-08-10 Thread Greg Snow
? Quoting Greg Snow [EMAIL PROTECTED]: My original intent was to get the original posters out of the mode of thinking they want to match what the spreadsheet does and into thinking about what message they are trying to get across. To get them (and possibly others) thinking I made

Re: [R] Plot legend in margin

2007-08-10 Thread Greg Snow
Another couple of things to think about: You could use the layout function to set up your multiple plots and include an extra plotting area at the bottom to place the legend in. If you stick with the solution below then the cnvrt.coords function from the TeachingDemos package may be useful (will

Re: [R] Subject: Re: how to include bar values in a barplot?

2007-08-09 Thread Greg Snow
with John Kane on Wed 1 August and again today on similar lines, and I think it's time an alternative point of view was presented, to counteract (I hope usefully) what seems to be a draconianly prescriptive approach to the presentation of information. On 07-Aug-07 21:37:50, Greg Snow

Re: [R] Subject: Re: how to include bar values in a barplot?

2007-08-09 Thread Greg Snow
think that Greg's points are valid too, and in this particular case, bar plots are a bad choice and adding numbers at variable heights causes a perception error as I wrote previously. Thanks for your elaboration on this important subject. Frank On 07-Aug-07 21:37:50, Greg

Re: [R] small sample techniques

2007-08-09 Thread Greg Snow
30 is not 30% of 300 (it is 10%), so your prop.test below is testing something different from your hand calculations. Try: prop.test(c(.30,.23)*300,c(300,300), correct=FALSE) 2-sample test for equality of proportions without continuity correction data: c(0.3, 0.23) * 300 out

Re: [R] simulation-binomial

2007-08-08 Thread Greg Snow
Does this do what you want? x2 - rbinom( 200, 1, ifelse(x, .95, p1/.6) ) y2 - rbinom( 300, 1, ifelse(y, .8, p1/.6) ) Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original Message- From:

Re: [R] Positioning text in top left corner of plot

2007-08-07 Thread Greg Snow
You can call par('usr') to find the current coordinates, then use the text function (the pos and offset arguments may be helpful as well) The cnvrt.coords function from the TeachingDemos package may also be of help for finding coordinates for the text function. Hope this helps, -- Gregory

Re: [R] How do I generate a grid of data in [0,1]?

2007-08-07 Thread Greg Snow
Try: data - expand.grid( a= seq(0,1,.1), b= seq(0,1,.1) ) Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of esh

Re: [R] how to include bar values in a barplot?

2007-08-07 Thread Greg Snow
Generally adding the numbers to a graph accomplishes 2 things: 1) it acts as an admission that your graph is a failure 2) it converts the graph into a poorly laid out table (with a colorful and distracting background) In general it is better to find an appropriate graph that does convey the

Re: [R] bars' values on barplot

2007-08-06 Thread Greg Snow
Why do you feel the need to add the numbers to your barplot? Occasionally this can be useful (and others have answered the question on how to do it), but often when you feel the need to add numbers to a graph you are really doing 2 things: 1. admitting the graph has failed 2. replacing the graph

Re: [R] Q: calling par() in .First()

2007-08-06 Thread Greg Snow
Be aware that the effects of calls to par usually only last for the duration of the graphics device, not the R session. If you put a call to par in your startup script, then it will open a graphics device and set the option, but if you close that graphics device and do another plot then a new

Re: [R] t-distribution

2007-08-03 Thread Greg Snow
Look at the power.examp and run.power.examp functions in the TeachingDemos package. Do these do what you want? If not you can look at the code in them to see how to fill part of the area under the curve. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain

Re: [R] two plots super-impose

2007-08-03 Thread Greg Snow
It's not clear exactly what you want, but you may want to look at the layout function, or the subplot function in the TeachingDemos package. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original Message- From:

Re: [R] boxplot hinge customization

2007-08-02 Thread Greg Snow
?bxp -Original Message- From: Pietrzykowski, Matthew (GE, Research) [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch r-help@stat.math.ethz.ch Sent: 8/2/07 6:04 AM Subject: [R] boxplot hinge customization Hello R users wiser than I - I am trying to produce a boxplot with quantiles defined

Re: [R] colored heights in 3D plot (persp)

2007-08-02 Thread Greg Snow
The persp function has a col argument that you can use to specify the colors. -Original Message- From: Juliane Willert [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch r-help@stat.math.ethz.ch Sent: 7/26/07 12:55 AM Subject: [R] colored heights in 3D plot (persp) Hello everybody, I have a

Re: [R] plot

2007-07-31 Thread Greg Snow
show outliers that may be of interest. From: Dong GUO ?? [mailto:[EMAIL PROTECTED] Sent: Sat 7/28/2007 10:19 PM To: Greg Snow Cc: r-help@stat.math.ethz.ch Subject: Re: [R] plot Thanks again, Greg, It really helps. Would you please let me know more reference

Re: [R] the large dataset problem

2007-07-30 Thread Greg Snow
Check out the biglm package for some tools that may be useful. -Original Message- From: Eric Doviak [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch r-help@stat.math.ethz.ch Sent: 7/30/07 9:54 AM Subject: [R] the large dataset problem Dear useRs, I recently began a job at a very large and

Re: [R] Q: extracting data from lm

2007-07-28 Thread Greg Snow
Marc gave some good general advice, here are a couple more things that are more specific to your problem. Remember that most R functions return information, sometimes invisibly, but it is good to save the results. This includes the summary function (all the numbers that get printed out are

Re: [R] plot

2007-07-27 Thread Greg Snow
Graphs that rely on 3-d effects tend to distort the data rather than enlighten the viewer. If your goal is to distort the data (which I doubt), then most of us don't want to help. On the other hand, if you really do want to enlighten the viewer (even if that is just you), then tell us what

Re: [R] plot

2007-07-27 Thread Greg Snow
Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original Message- From: Dong GUO 郭东 [mailto:[EMAIL PROTECTED] Sent: Friday, July 27, 2007 12:09 PM To: Greg Snow Cc: r-help@stat.math.ethz.ch Subject: Re: [R] plot Many thanks, Greg and Justin. The matrix

Re: [R] Function to separate effect in AOV

2007-07-26 Thread Greg Snow
You may want to look at the interaction function (a quick way to make the single factor with 4 levels that you mention). You can create your own sets of contrasts and set them using the C or contrasts functions, then use the split argument to summary.aov to look at the individual degrees of

Re: [R] Redirecting print output

2007-07-26 Thread Greg Snow
You may want to look at the R2HTML package as one approach (others have already told you about sink and cat). Another approach is to use the variations on sweave. Here you set up a template file with the code you want run as well as any explanitory text (you can even write an entire report),

Re: [R] multiple graphs

2007-07-26 Thread Greg Snow
One of the nice things about the R Graph Gallery is that if you click on the R logo underneath the graph (may need to scroll down a bit) it will show you the code used to create that particular graph. You may also want to look at the subplot function in the TeachingDemos package for another way

Re: [R] Trend lines on a scatterplot matrix

2007-07-23 Thread Greg Snow
Start with something like this: pairs(iris, panel= function(x,y,...){ points(x,y); abline(lm(y~x))}) Then substitute in your data and extra args and any other enhancements you want. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain

Re: [R] using R for a reaction-time experiment

2007-07-23 Thread Greg Snow
Under windows you could use a graphics window for the stimulus and capture the keypress using the getGraphicsEvent function (this does not require hitting enter, but the graphics window needs to be the active window through the experiment). The playSudoku function in the sudoku package shows one

Re: [R] passing a parameter to a file from command line

2007-07-18 Thread Greg Snow
Look at the commandArgs function to see if that does what you want. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Aydemir, Zava

Re: [R] multiple rugs on a single plot

2007-07-17 Thread Greg Snow
The rug function will take line and position arguments for the location of the rug plot, so you can do something like: rug( x1, line=0 ) rug( x2, line=1 ) rug( x3, line=2 ) Where line=0 means right on the x axis, line=1 means 1 textline height below the x axis (-1 would be the same distance

Re: [R] Speed up computing: looping through data?

2007-07-17 Thread Greg Snow
There are many options that can help, but which to use depends a lot on what your research question is. What are you really looking for in these relationships? Here are a couple of tools that may help. If my.data is a matrix or data.frame with just the variables of interest then look at

Re: [R] Compute rank within factor groups

2007-07-16 Thread Greg Snow
Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original Message- From: Ken Williams [mailto:[EMAIL PROTECTED] Sent: Thursday, July 12, 2007 3:50 PM To: Greg Snow; R-help@stat.math.ethz.ch Subject: Re: [R] Compute rank within factor groups On 7/12/07 4:28 PM, Greg Snow

Re: [R] correlation matrix difference

2007-07-16 Thread Greg Snow
One approach would be to use a permutation test. Lets start with a simpler case: x1 and y1 are 2 variables measured under condition 1 and x2 and y2 are the same variables measured under condition 2. The null hypothesis is that conditions 1 and 2 make no differences on the measurements (same

Re: [R] Question about acception rejection sampling - NOT R question

2007-07-16 Thread Greg Snow
Not a strict proof, but think of it this way: The liklihood of getting a particular value of x has 2 parts. 1st x has to be generated from h, the liklihood of this happening is h(x), 2nd the point has to be accepted with conditional probability f(x)/(c*h(x)). If we multiply we get h(x) * f(x)/

Re: [R] Interpreting a string as a variable in a column header

2007-07-12 Thread Greg Snow
Use xx[[gene]] instead of xx$gene (the $ is a shorthand for [[ with some extra magic to be more convenient, the magic is getting in your way, so go back to the [[ syntax (make sure you double the braces)). Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain

Re: [R] calculating percent error from 2 vectors

2007-07-12 Thread Greg Snow
Try something like: mytable - table(known, modelout) prop.table( mytable, 1 ) Also look at ?addmargins and the CrossTable function in the gmodels package. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111

Re: [R] Compute rank within factor groups

2007-07-12 Thread Greg Snow
Look at ?ave and try something like: wc$rank - ave( wc$score, wc$report, FUN=rank ) This works even if the dataframe is not pre sorted. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original

Re: [R] Compute rank within factor groups

2007-07-12 Thread Greg Snow
PROTECTED] (801) 408-8111 -Original Message- From: Ken Williams [mailto:[EMAIL PROTECTED] Sent: Thursday, July 12, 2007 2:50 PM To: Greg Snow; R-help@stat.math.ethz.ch Subject: Re: [R] Compute rank within factor groups On 7/12/07 3:42 PM, Ken Williams [EMAIL PROTECTED] wrote

Re: [R] Power calculation for the time series experiment

2007-07-11 Thread Greg Snow
The built in power functions are for the fairly straight forward situations. Yours does not appear to fit into any of those. You need to think through your problem a bit more before starting to think about power. What do you mean by effect size of 1.5 (is that 1.5 standard deviations? Or raw

Re: [R] type III ANOVA for a nested linear model

2007-07-10 Thread Greg Snow
I nominate the following 2 pieces from Bill's reply for fortunes (probably 2 separate fortunes): All this becomes even more glaring if you take the unusal step of plotting the data. and What sort of editor would overlook this clear and demonstrable message leaping out from the data in

Re: [R] sink() and source()

2007-07-05 Thread Greg Snow
I don't know what is causing your problem, But if you goal is to produce html then you may want to look at the R2HTML package. It may do what you want without using sink. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801)

Re: [R] help with vector construction

2007-07-05 Thread Greg Snow
One approach is to use the fact that vectors are automatically replicated to the correct length when subscripting, so you can do something like: my.matrix[ c(FALSE,TRUE,FALSE), 3 ] To get every 3rd element starting at the 2nd element, and the 3rd column. Hope this helps, -- Gregory (Greg)

Re: [R] vertically concatenating data frames

2007-07-03 Thread Greg Snow
Use rbind instead of c: df - rbind(df1,df2) Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Aydemir, Zava

Re: [R] Combine graphical and textual output

2007-07-02 Thread Greg Snow
The R2HTML package can be used to create and html transcript of your session (you do need to start, end, and tell it to include graphs). I use this when doing an R demonstration (teaching), so that the students can have a transcript that shows the commands I typed along with their output

Re: [R] shading bar charts

2007-06-29 Thread Greg Snow
The first question you should ask yourself (and really think about the answer) is Why do I want to do this? Fancy colors and shadings can detract from a plot rather than enhance it. The wrong choice of colors can make bars look bigger or smaller than they really are. Reading Tufte's The visual

Re: [R] sampling question

2007-06-28 Thread Greg Snow
The sample function has a prob argument that determines the probabilities of each element being sampled, put your proportion of women in there and see if that works for you. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111

Re: [R] applying max elementwise to two vectors

2007-06-28 Thread Greg Snow
Are you looking for pmax? (look at the help ?pmax and the examples and see if that does what you want). -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL

Re: [R] Power calculation with measurement error

2007-06-26 Thread Greg Snow
I don't know of a current package that does this (others may), but if you know what you expect your data to look like you can simulate it and calculate power that way. Basically, write a function that will simulate data with the level of measurement error that you expect in the real data (or have

Re: [R] how to iterate

2007-06-26 Thread Greg Snow
Here is one approach: tmp - scan() 1: 1 127 1 261 1 142 1 183 1 234 1 162 2 173 2 321 2 168 2 20: 197 2 213 2 261 3 198 3 126 3 167 3 154 3 134 3 187 3 109 3 210 41: Read 40 items my.df - as.data.frame( matrix(tmp, ncol=2, byrow=TRUE) ) names(my.df) - c('Category','Variable')

Re: [R] Looking for parallel functionality between Matlab and R

2007-06-26 Thread Greg Snow
For a), if you really want the plots overlayed, it is best to use something like matplot, or use the points or lines function to add the later plots to the first. You can also get the overlay effect using par(new=TRUE), but then you need to be careful with axis labels and scales and the plot may

Re: [R] How to shadow 'power' area?

2007-06-25 Thread Greg Snow
You can look at the power.examp function in the TeachingDemos package to see if it gives you the graph you want, or look at the code to see how you could modify it to give you the plot you want. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED]

Re: [R] axis labels in multiple plots

2007-06-20 Thread Greg Snow
There are 2 approaches that should work for you (actually there are probably more, but these 2 are what I would suggest). The first is to wrap barplot in your own function that also adjusts the parameters and adds the axis. The other is to use the output from subplot to go back and annotate

Re: [R] plot only x- and y-axis with origin, no box()

2007-06-19 Thread Greg Snow
Try: plot(.., bty='l') Does that do what you want? (see the bty parameter in ?par for details) If you don't want the lines extending beyond the axes on the right and top then you could do something more like: plot(5:10, 5:10, bty='n') library(TeachingDemos) lines(cnvrt.coords( c(0,0,.5),

Re: [R] A question about plots and lists in functions

2007-06-19 Thread Greg Snow
?invisible -Original Message- From: Jason Q McClintic [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch r-help@stat.math.ethz.ch Sent: 6/19/07 2:04 PM Subject: [R] A question about plots and lists in functions R-helpers: I tried googling and couldn't find anything. I have a function I am

Re: [R] triangle contour plots

2007-06-18 Thread Greg Snow
The triplot function in the TeachingDemos package (I don't know about the one in klaR, or the others mentioned) honors the type='l' argument and passes it on to points. So if you know where you want the contours drawn, you can use triplot to draw the lines (it also has an add argument that could

Re: [R] R vs. Splus in Pharma/Devices Industry

2007-06-15 Thread Greg Snow
-Original Message- From: Kuhn, Max [mailto:[EMAIL PROTECTED] Sent: Thursday, June 14, 2007 3:11 PM To: Greg Snow; [EMAIL PROTECTED]; r-help@stat.math.ethz.ch Subject: RE: [R] R vs. Splus in Pharma/Devices Industry Greg, Thanks for the kind words about odfWeave

Re: [R] [OT]Web-Based Data Brushing

2007-06-14 Thread Greg Snow
There is the TkBrush function in the TeachingDemos package for R. It is not web based. -Original Message- From: Roy Mendelssohn [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch r-help@stat.math.ethz.ch Sent: 6/12/07 10:26 AM Subject: [R] [OT]Web-Based Data Brushing I apologize for the

Re: [R] ievent.wait

2007-06-14 Thread Greg Snow
when the function is called. Stone. Sundar Dorai-Raj wrote: Hi, Greg, type = 'b' won't work according to ?locator. Try type = 'o'. HTH,x --sundar Greg Snow said the following on 6/13/2007 7:27 AM: Does locator(type='l') (or type ='b') Work for you

Re: [R] R vs. Splus in Pharma/Devices Industry

2007-06-14 Thread Greg Snow
But sweave is expanding. There is a driver for HTML sweaving in the R2HTML package and the odfWeave package allows you to sweave with open office docs (which can be converted to/from MS word). I personally like using LaTeX and the original sweave, but I work with people who want everything in MS

Re: [R] question about formula for lm

2007-06-14 Thread Greg Snow
Try: lm( formula( paste( Ytext, '~ Xvar' ) ), data=X) -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Pedro Mardones Sent:

Re: [R] R vs. Splus in Pharma/Devices Industry

2007-06-14 Thread Greg Snow
In my case, the MS word users know just enough about statistics to know that they need a statistician (me or one of my group), so it is usually me that sets up the template. This is generally for a set of graphs/tables that will be included in a paper or presentation. They do most of the initial

Re: [R] ievent.wait

2007-06-13 Thread Greg Snow
Does locator(type='l') (or type ='b') Work for you? -Original Message- From: ryestone [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch r-help@stat.math.ethz.ch Sent: 6/8/07 10:19 AM Subject: [R] ievent.wait I am working on a plot and would be like to click on a few points and then

Re: [R] barplot and map overlay

2007-06-13 Thread Greg Snow
Look at the subplot function in the TeachingDemos package. -Original Message- From: Héctor Villalobos [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch r-help@stat.math.ethz.ch Sent: 6/11/07 5:48 PM Subject: [R] barplot and map overlay Hi, I wonder if it is possible with the graphics

Re: [R] overplots - fixing scientific vs normal notation in output

2007-06-08 Thread Greg Snow
Peter Lercher wrote: -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter Lercher Sent: Friday, June 08, 2007 3:07 AM To: r-help@stat.math.ethz.ch Subject: [R] overplots - fixing scientific vs normal notation in output Moving from S-plus to

Re: [R] Different fonts on different axes

2007-05-31 Thread Greg Snow
Try this: plot(runif(10), ylab=, xlab=Black, standard?) mtext('Red, Bold', side=2, line=3, col='red', font=2) Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original Message- From: [EMAIL

Re: [R] Import data from Access

2007-05-31 Thread Greg Snow
You need to do 1 of 2 things (but not both). Either register your database file with your odbc driver (done outside of R) Or Use odbcConnectAccess in place of odbcConnect The 2nd is simpler if you just want to import that file, the first may be better in the long run if you are going to be

Re: [R] opinions please: text editors and reporting/Sweave?

2007-05-30 Thread Greg Snow
Tim, First, I personnally am a big fan of LaTeX, Emacs, and ESS and I think that in the long run you would benefit from learning all of them (probably start with Emacs, then ESS, then LaTeX once you already have a knowledge of Emacs and how it can help). Since you asked about the simplest way to

Re: [R] {10,20,30}={25,30,15}

2007-05-21 Thread Greg Snow
To decide on which way to do a one tailed test, you should really ask a few questions (before looking at the data) either of yourself, your client, or other expert in the field. I would start by asking the 3 questions: 1. What will I/you do if A is less than B? 2. What will I/you do if A is

Re: [R] Graphically show population density for a specific geographicarea using R

2007-05-21 Thread Greg Snow
1. Yes you need a shape file with that information. 2. One place to look is: http://www.census.gov/geo/www/cob/bdy_files.html There are shapefiles (the .shp ones) for counties and zip codes (as well as many other things). These work pretty directly with the tools in the maptools and sp packages.

  1   2   3   4   >