Re: [R] Don't understand plotmath behaviour (bug?)

2005-07-30 Thread Peter Dalgaard
Gabor Grothendieck [EMAIL PROTECTED] writes: Numbers, not in characters strings do not come out bold: plot(1:5, type = n) text(x=3,y=3, quote(bold(paste(a==a ~~ 0.5 == 0.5 (what's the paste() for?) ...and it is a design choice of course. Notice that operators are not boldfaced either,

Re: [R] Binary outcome with non-absorbing outcome state

2005-07-30 Thread Renaud Lancelot
Frank Funderburk a écrit : Singer Willett (2003) also cover this ground. Singer, JD Willett, JB (2003). Applied longitudinal data analysis: Modeling change and event occurrence. New Yok: Oxford University Press. -Original Message- From: Frank E Harrell Jr [EMAIL PROTECTED]

[R] How to hiding code for a package

2005-07-30 Thread Gary Wong
Hey everyone, I have made a package and wish to release it but before then I have a problem. I have a few functions in this package written in R that I wish to hide such that after installation, someone can use say the function foo(parameters = ) but cannot do foo. Typing foo should not show the

Re: [R] How to hiding code for a package

2005-07-30 Thread Prof Brian Ripley
What you ask is impossible. For a function to be callable it has to be locatable and hence can be printed. One possibility is to have a namespace, and something like foo - function(...) foo_internal(...) where foo is exported but foo_internal is not. Then foo_internal is hidden from casual

Re: [R] Don't understand plotmath behaviour (bug?)

2005-07-30 Thread Gabor Grothendieck
On 30 Jul 2005 09:16:26 +0200, Peter Dalgaard [EMAIL PROTECTED] wrote: Gabor Grothendieck [EMAIL PROTECTED] writes: Numbers, not in characters strings do not come out bold: plot(1:5, type = n) text(x=3,y=3, quote(bold(paste(a==a ~~ 0.5 == 0.5 (what's the paste() for?) I had a

Re: [R] How to hiding code for a package

2005-07-30 Thread Gabor Grothendieck
You could set the source attribute like this: R f - function(x) x+1 R # displays the word hidden instead of showing the source R attr(f, source) - hidden R f hidden R f(10) # still works as a function properly [1] 11 Of course, someone knowledgable could change the source attribute back but

[R] Wild card characters

2005-07-30 Thread Dhiren DSouza
I have a string '982323.1' and would like to replace everything after the '.' with a '41'. So the string should look like '982323.41'. The code I use to do this is sub('\.$','41',982323.1) This works fine as long as there is only 1 digit after the decimal. If I have '982323.10', then the

Re: [R] Wild card characters

2005-07-30 Thread Uwe Ligges
Dhiren DSouza wrote: I have a string '982323.1' and would like to replace everything after the '.' with a '41'. So the string should look like '982323.41'. The code I use to do this is sub('\.$','41',982323.1) You have to escape \, see ?regexp: sub('\\.[[:digit:]]*$','\\.41',

[R] xyplot auto.key issue

2005-07-30 Thread Mike Lawrence
Hi all, I'm having a problem with the auto.key function in xyplot. I hate to bother the list like this and I'm positive I must be missing something very simple, yet I've spent the last day searching for a solution to no avail. Essentially, I want a key that contains entries in which the plot

Re: [R] xyplot auto.key issue

2005-07-30 Thread Mike Lawrence
Quick correction: The lines lines = T, type = b in the par.settings section should not be there. They are remnants of my previous (failed) attempts at solving the problem. Below is the correct code: xyplot( #basic settings bias ~ sample_size | measure, data = bias,

[R] Premature termination of script

2005-07-30 Thread Marco Blanchette
I am fairly new to R and I am writing a script that would take a file, as an input, and generates a bunch of graphs out of it. My first task is to be sure that the file is of the right type by looking if there is a valid barcode in it as in (the barcode is beetween a double and single underscore):

Re: [R] Wild card characters

2005-07-30 Thread Gabor Grothendieck
Another way to do it is: sub([.].*, .41, x) This says to replace the first dot and everything after by .41. When . appears in a character class, i.e. [.], then you don't need backslashes. Also you don't need backslashes in the second argument. On 7/30/05, Uwe Ligges [EMAIL PROTECTED]

Re: [R] Wild card characters

2005-07-30 Thread Dhiren DSouza
Thank you both :) -Dhiren From: Gabor Grothendieck [EMAIL PROTECTED] Reply-To: Gabor Grothendieck [EMAIL PROTECTED] To: Uwe Ligges [EMAIL PROTECTED] CC: Dhiren DSouza [EMAIL PROTECTED], r-help@stat.math.ethz.ch Subject: Re: [R] Wild card characters Date: Sat, 30 Jul 2005 16:31:37 -0400 Another

Re: [R] Premature termination of script

2005-07-30 Thread Gabor Grothendieck
On 7/30/05, Marco Blanchette [EMAIL PROTECTED] wrote: I am fairly new to R and I am writing a script that would take a file, as an input, and generates a bunch of graphs out of it. My first task is to be sure that the file is of the right type by looking if there is a valid barcode in it as in

Re: [R] Premature termination of script

2005-07-30 Thread Patrick Burns
You can use 'stop' instead of 'cat' -- in which case you don't need the newline at the end of the string. But I suspect you would be better off writing a function rather than a script. S Poetry is one of many sources on writing functions. Patrick Burns [EMAIL PROTECTED] +44 (0)20 8525 0696

[R] partial SS for anova

2005-07-30 Thread NATALIA F TCHETCHERINA
Hello, I use lme4 package. library(lme4) fit=lmer(y ~ time+dye+trt+trt:time + (1|rep), data=dataset, na.action='na.omit') anova(fit) The anova gives sequential F-tests and sequential SS. My question is: how I can get partial F-tests and partial SS? For lm (not lmer) anova(lm(y~x+z)) we can

Re: [R] Minimum-chi-square estimation

2005-07-30 Thread Spencer Graves
I just got 11 hits with RSiteSearch(minimum chi-square); none of them seemed relevant. If you still have time and interest for this, why don't you tell us about the problem you are trying to solve and why you think minimum chi-square is appropriate? You should be able to

Re: [R] catching errors in a loop

2005-07-30 Thread Spencer Graves
Unfortunately, I don't know how to get any more information from nls. My approach to this kind of problem is to write my own function to compute the sum of squares and then use optim(..., hessian=TRUE). This is less likely to choke, because optim will continue with a singular

Re: [R] Forcing coefficents in lm(), recursive residuals, etc.

2005-07-30 Thread Spencer Graves
I know nothing about recresid, but does the following help: x - 1:4 set.seed(1) DF - data.frame(x=x, y=x+rnorm(4)) fit - lm(y~offset(x), DF) recresid(fit) [1] 1.2799320 0.7232336 3.4826581 spencer graves Rick Ram wrote: Hi all, Just to clarify, I know that the

Re: [R] Errbar()-function, cap and logarithmic scaling

2005-07-30 Thread Spencer Graves
I just got 23 hits from 'RSiteSearch(errbar)'. The second was a help file for errbar in sfsmisc, noting there was a similar function in Hmisc. PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html;. In particular, please provide a self-contained,

Re: [R] xyplot auto.key issue

2005-07-30 Thread Deepayan Sarkar
On 7/30/05, Mike Lawrence [EMAIL PROTECTED] wrote: Quick correction: The lines lines = T, type = b in the par.settings section should not be there. They are remnants of my previous (failed) attempts at solving the problem. Below is the correct code: xyplot( #basic settings