Re: [R] shading between two smoothed curves

2009-08-13 Thread Bert Gunter
?polygon Bert Gunter Genentech Nonclinical Biostatisics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Graves, Gregory Sent: Thursday, August 13, 2009 11:17 AM To: r-help@r-project.org Subject: [R] shading between two smoothed

Re: [R] psi not functioning in nlrob?

2009-08-13 Thread Keo Ormsby
I hadn't checked this, I only had used the default. The problem stems from the reassigned weighs during nls iterations, where the psi.bisquare function can return some 0 weight values, which then returns some NaN values in the resid vector that is calculated by dividing residuals/weights.

Re: [R] Need Advice: Considering Converting a Package from S3 to S4 -- reprise

2009-08-13 Thread Terry Therneau
I read the list in digest form which sometimes makes me late to respond. Peter Dalgaard wrote: In all fairness, it should probably be noted that quite a few people swear BY S4 in addition to those who swear AT it. Lest I give the impression of only dislike -- the coxme package (major rewrite

[R] glm.nb versus glm estimation of theta.

2009-08-13 Thread hesicaia
Hello, I have a question regarding estimation of the dispersion parameter (theta) for generalized linear models with the negative binomial error structure. As I understand, there are two main methods to fit glm's using the nb error structure in R: glm.nb() or glm() with the

Re: [R] How to get the n (number of observations) per conditional group

2009-08-13 Thread Dax
I found a work-around by just simply getting the sum of the conditional values and dividing this by the mean. It's not elegant but it works On Aug 13, 3:11 pm, Dax rienk.doet...@gmail.com wrote: Hello all, I have a huge data set that I'm cleaning up a bit. I am extracted the means per

[R] Adding logical vectors

2009-08-13 Thread David Huffer
When adding several logical vectors I expect each vector will be coerced to integers and these vectors will then be added. That doesn't always seem to be the case. For example: ( f1 - as.factor ( sample ( x , 25 , rep = T ) ) ) [1] x x x x x x x x x x x x x x x x x x x x x x x x x

[R] Data Envelopment Analysis

2009-08-13 Thread Thiagarajah Ramilan
Hi, solict excuese if I am reposting I am not sure I properly posted the previous message In the past I have used a DEA package known as FEAR on R platform. I could not see that package any more. Instead a new package is there DEA. I kindly apreciate comments or recomendations. Ramilan

[R] using package tm to find phrases

2009-08-13 Thread Mark Kimpel
I am using the package tm for text-mining of abstracts and would like to use it to find instances of gene names that may contain white space. For instance gene regulatory protein 1. The default behavior of tm is to parse this into 4 separate words, but I would like to use the class constructor

Re: [R] Adding logical vectors

2009-08-13 Thread Ted Harding
On 13-Aug-09 19:21:36, David Huffer wrote: When adding several logical vectors I expect each vector will be coerced to integers and these vectors will then be added. That doesn't always seem to be the case. For example: ( f1 - as.factor ( sample ( x , 25 , rep = T ) ) ) [1] x x x

[R] Finding minimum of time subset

2009-08-13 Thread Tim Clark
Dear List, I have a data frame of data taken every few seconds. I would like to subset the data to retain only the data taken on the quarter hour, and as close to the quarter hour as possible. So far I have figured out how to subset the data to the quarter hour, but not how to keep only the

Re: [R] Browser and Debug?

2009-08-13 Thread rkevinburton
If I am on Windows and don't have GDB it does'nt look like it is possible. Any tips? Kevin roger koenker rkoen...@uiuc.edu wrote: At points of total desperation you can always consider the time-honored, avuncular advice -- RTFM, in this case Section 4.4 of Writing R Extensions.

[R] request: Help

2009-08-13 Thread Sarjinder Singh
Dear Sir/Madam,   Good Day!   How can we make output file in R?   In FORTRAN, we could do as follows:       WRITE (42, 107) x, y 107  FORMAT ( 2x, F9.3, 2x, F4.2)   What is equivalent to this in R?   With best regards,   Sarjinder                 Updated web-page on Sept 6, 2004:  

[R] R: how to get R interpreter to remember constant values without using any memory location

2009-08-13 Thread mauede
Thank you for all your suggestiona. I tried to write a self-contained example which turned oiut to confuse people's miind. I realized also the formulation of my question was unclear. Sorry for that. What I had in mind was something similar to Fortran Parameter declaration. I spent some time

[R] lm coefficients output confusing

2009-08-13 Thread Ross Culloch
Hi all, I have an issue with the lm() function regarding the listing of the coefficients. My data are below, showing a list of hours (HR) relating to the time spent resting (R) by an individual animal. Simply i want to run a lm() to run in an anova() to see if there is a significant difference

[R] tick.number in ggplot2?

2009-08-13 Thread Ben Bolker
Another dumb ggplot2 question: a facet plot with free x scale, lots of different ranges, want to specify that the x axis ticks be sparse -- only 2 or 3. I was about to say that I could figure out how to manually set the ticks for each facet if necessary, but now that I've looked around some

[R] Coding problem: How can I extract substring of function call within the function

2009-08-13 Thread Pitt, Joel
In order to ease my students into the R environment I am developing a package which installs a variety of utility functions as well as slightly modified versions of some standard R functions -- e.g. mean, hist, barplot, In my versions of these standard R functions I either add options or

Re: [R] Coding problem: How can I extract substring of function call within the function

2009-08-13 Thread Erik Iverson
Are you sure you just don't want to tell them about the :: operator? It sounds easier than what you're proposing. E.g., base::mean(c(1:10, NA)) -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Pitt, Joel Sent: Thursday, August

Re: [R] request: Help

2009-08-13 Thread Steve Lianoglou
Hi, On Aug 13, 2009, at 3:43 PM, Sarjinder Singh wrote: Dear Sir/Madam, Good Day! How can we make output file in R? In FORTRAN, we could do as follows: WRITE (42, 107) x, y 107 FORMAT ( 2x, F9.3, 2x, F4.2) What is equivalent to this in R? See: ?file ?cat ?sprintf -steve --

Re: [R] Coding problem: How can I extract substring of function call within the function

2009-08-13 Thread Gabor Grothendieck
The Defaults package can be used to change the defaults of functions and reset them back. There is some question on whether all this is advisable. It will invalidate any books, documentation, examples in the help files that come with R and other resources on R that they might have otherwise used

Re: [R] Coding problem: How can I extract substring of function callwithin the function

2009-08-13 Thread Pitt, Joel
Thanks. It's a great solution to part of my problem. It provides the functionally I want would be no harder for students to use than my approach. I'm still interested in how to make what I was trying to do work -- simply to add to my own R programming proficiency. Joel

[R] joining two points in rgl

2009-08-13 Thread Nair, Murlidharan T
Hi!! I need to draw a cylinder/tube joining two points. I am trying to make something presentable, I have been able to do it using lines3d. But is it possible to increase the thickness of the lines? The size parameter does not work. Does any one have any suggestions? Thanks ../Murli

Re: [R] lm coefficients output confusing

2009-08-13 Thread Ted Harding
On 13-Aug-09 20:45:31, Ross Culloch wrote: Hi all, I have an issue with the lm() function regarding the listing of the coefficients. My data are below, showing a list of hours (HR) relating to the time spent resting (R) by an individual animal. Simply i want to run a lm() to run in an

Re: [R] lm coefficients output confusing

2009-08-13 Thread Daniel Malter
I have answered a similar question just hours ago. Your question either indicates an unfamiliarity with R or, more generally, an unfamiliarity with regression analysis, or both. Your anova indicates that the overall model is significant. That is, your model is an improvement over the null model

Re: [R] using package tm to find phrases

2009-08-13 Thread Ingo Feinerer
On Thu, Aug 13, 2009 at 03:36:22PM -0400, Mark Kimpel wrote: I am using the package tm for text-mining of abstracts and would like to use it to find instances of gene names that may contain white space. For instance gene regulatory protein 1. The default behavior of tm is to parse this into 4

Re: [R] Coding problem: How can I extract substring of function callwithin the function

2009-08-13 Thread Pitt, Joel
Your objections are quite cogent, but I believe they are misdirected. I'm not at all interested in having my students ignore the existence of NA's and that's precisely why I'm not using the Default package as someone else suggested. But the mere existence of missing values in a data set doesn't

Re: [R] R code to reproduce (while studying) Bates Watts 1988

2009-08-13 Thread Kevin Wright
library(nlme) m2 - gnls(conc ~ t1*(1-t2*exp(-k*time)), data = df.Chloride, start = list( t1 = 35, t2 = 0.91, k = 0.22)) summary(m2) plot(m2) lag.plot(resid(m2), do.lines=FALSE) acf(resid(m2)) m3 - update(m2, corr=corAR1(.67))

[R] How to rename columns that start with numbers?

2009-08-13 Thread Mark Na
Hello, My dataframe has new columns that start with the number 1 or 2 (resulting from a reshape cast command). Instead of having these columns automatically renamed by R so start with the letter X, I would like to rename these columns to start with the characters SURV_ (e.g., SURV_1, SURV_2). I

Re: [R] R: how to get R interpreter to remember constant values without using any memory location

2009-08-13 Thread Don MacQueen
You can add or remove elements from a list without affecting the other elements. It is not necessary to update the list names when adding or removing elements. Since list elements can be referred to by name, you don't have to worry about numbering them, or renumbering them, nor do you have to

Re: [R] Coding problem: How can I extract substring of function call within the function

2009-08-13 Thread Pitt, Joel
Hi, As I said in my original email, I'm sure that many of you will doubt the wisdom of what I'm trying to do -- and I certainly share some of your misgivings. I have misgivings too about the use of training wheels for bicycles, but they are clearly useful for some people, and, in this

Re: [R] shading between two smoothed curves

2009-08-13 Thread Debabrata Midya
Hi Gregory, I can plot out two nice curves using the following code, but I can't figure out how to shade in the area lying between the two curves. Use polygon. ?polygon Graves, Gregory ggra...@sfwmd.gov 14/08/2009 4:17 am I have a set of 52 weekly values, one is the desired high lake

Re: [R] How to rename columns that start with numbers?

2009-08-13 Thread John Kane
Something like this. Create empty vector of correct length, paste values into it and then use names(mydata) - myvector. x - data.frame(aa=1:10, bb=letters[1:10]) myvector - c(rep(NA,length(x))) for (i in 1:length(names(x))) { myvector[i] - paste(SURV_,i, sep=) } --- On Thu, 8/13/09,

Re: [R] glm.nb versus glm estimation of theta.

2009-08-13 Thread Achim Zeileis
On Thu, 13 Aug 2009, hesicaia wrote: Hello, I have a question regarding estimation of the dispersion parameter (theta) for generalized linear models with the negative binomial error structure. As The theta is different from the dispersion. In the usual GLM notation: E[y] = mu VAR[y] =

Re: [R] How to plot 3-D surface graph from lmer mixed models?

2009-08-13 Thread Duncan Murdoch
willow1980 wrote: Dear Professor Murdoch, That is exactly the difficulty for me. I don't know how to make a prediction with lmer using expand.grid; at the moment, I can use “mo...@x%*%fixef(model)” to get predicted values for existing observational data, but not data by expand.grid. Actually, if

Re: [R] Browser and Debug?

2009-08-13 Thread Duncan Murdoch
rkevinbur...@charter.net wrote: If I am on Windows and don't have GDB it does'nt look like it is possible. Any tips? For debugging without a debugger, you can always use the old-fashioned method of inserting print statements (Rprintf in C). But you want to do this without a debugger

Re: [R] joining two points in rgl

2009-08-13 Thread Duncan Murdoch
Nair, Murlidharan T wrote: Hi!! I need to draw a cylinder/tube joining two points. I am trying to make something presentable, I have been able to do it using lines3d. But is it possible to increase the thickness of the lines? The size parameter does not work. Does any one have any suggestions?

Re: [R] Coding problem: How can I extract substring of function callwithin the function

2009-08-13 Thread Steve Lianoglou
Hi Joel, On Aug 13, 2009, at 6:10 PM, Pitt, Joel wrote: Your objections are quite cogent, but I believe they are misdirected. I'm not at all interested in having my students ignore the existence of NA's and that's precisely why I'm not using the Default package as someone else suggested.

Re: [R] glm.nb versus glm estimation of theta.

2009-08-13 Thread Bill.Venables
Whoa! Just hang on a minute. theta is NOT the dispersion parameter. Under the NB model, the variance of an observation is mu+mu^2/theta, so that's how theta enters the picture. The smaller theta is the larger the variance. glm(..., family = negative.binomial(theta = something), ...)

Re: [R] Plotting sigma symbol with unicode and turning into pdf

2009-08-13 Thread Paul Murrell
Hi Jonathan R. Blaufuss wrote: Paul, You solution worked out really well when I ran my code in R. However, when I try to turn the plot into a pdf, the unicode string no longer seems to function and instead of the sigma symbol there are just two periods (See example code below). The following

[R] problem about t test

2009-08-13 Thread Gina Liao
Hello, I have a data frame str(dat)'data.frame': 2 obs. of 30 variables it contains two information-two types of cancers:stage A(A1 to A10) and stage B(B1 to B20) ##totally 30 patients-2 sets of gene expression I'd like to find the lists for top 20 differentially expressed genes using

Re: [R] problem about t test

2009-08-13 Thread Moshe Olshansky
You could do the following: y - apply(dat,1,function(a) t.test(a[1:10],a[11:30])$p.value) This will produce an array of 2 p-values. --- On Fri, 14/8/09, Gina Liao yi...@hotmail.com wrote: From: Gina Liao yi...@hotmail.com Subject: [R] problem about t test To: r-h...@stat.math.ethz.ch

Re: [R] Simulating points from GLM corresponding to new x-values

2009-08-13 Thread Jacob Nabe-Nielsen
Hi Cliff, Excellent, just what I needed -- wish I had thought of that myself. Thanks a lot! Jacob On 13 Aug 2009, at 01:49, Clifford Long wrote: Hi Jacob, At the risk of embarrassing myself, I gave it a shot. I'll throw this out on the list, if for no other reason than perhaps someone

Re: [R] Solutions of equation systems

2009-08-13 Thread Moshe Olshansky
Is your system of equations linear? --- On Fri, 14/8/09, Moreno Mancosu nom...@tiscali.it wrote: From: Moreno Mancosu nom...@tiscali.it Subject: [R] Solutions of equation systems To: r-help@r-project.org Received: Friday, 14 August, 2009, 2:29 AM Hello all! Maybe it's a newbie

<    1   2