Re: [R] How to detect NULL list element?

2008-11-03 Thread Barry Rowlingson
2008/11/3 <[EMAIL PROTECTED]>: > So how do I detect the NULL at r[1]? How can you detect what is not there? Single square brackets on a list give you a list. Double square brackets give you the elements. is.null(r[[1]]) should be TRUE. Barry __

Re: [R] How to detect NULL list element?

2008-11-03 Thread Wacek Kusnierczyk
Barry Rowlingson wrote: > 2008/11/3 <[EMAIL PROTECTED]>: > > >> So how do I detect the NULL at r[1]? >> > > How can you detect what is not there? > > Single square brackets on a list give you a list. Double square > brackets give you the elements. > > is.null(r[[1]]) should be TRUE. >

[R] [R-pkgs] scuba 1.2-2 posted

2008-11-03 Thread Adrian Baddeley
scuba 1.2-2 'scuba' is a contributed package that performs theoretical calculations about scuba diving --- dive profiles, decompression models, gas toxicity and so on. New features in version 1.2-2: . Package vignette provides detailed explanations. . Improved handling of

Re: [R] Splitting device for ggplots?

2008-11-03 Thread Vitalie Spinu
Thanks Baptiste and Hadley, That viewports mechanism is indeed extremely versatile when it comes to publication or designing new plot functions. But for interactive analysis all these "pushing" and "popping" is just a way too much code - for each plot at least two additional grid functions,

[R] Fourier Transform with irregularly spaced x

2008-11-03 Thread Claudia Beleites
Dear all, I work with (vibrational) spectra: some kind of intensity (I) over frequency (nu), wavelength or the like. I want to do fourier transform for interpolation, smoothing, etc. My problem is that the spectra are often irregularly spaced in nu: the difference between 2 neighbouring nu var

[R] qr() and Gram-Schmidt

2008-11-03 Thread cruz
Hi, Why the qr() produces a negative Q compared with Gram-Schmidt? (note example below, except Q[2,3]) Here is an example, I calculate the Q by Gram-Schmidt process and compare the output with qr.Q() a <- c(1,0,1) b <- c(1,0,0) c <- c(2,1,0) x <- matrix(c(a,b,c),3,3) ##

[R] need some help

2008-11-03 Thread Kurapati, Ravichandra (Ravichandra)
Hi , > df Session_Setup DCT FwdDataVols_bin countsComp 1 User_Initiated NoRLL 1 5058 User_Initiated+NoRLL+1 2 User_Initiated NoRLL 2584 User_Initiated+NoRLL+2 3 User_Initiated NoRLL 3191 User_Initiated+NoRL

Re: [R] Best way of figuring out whether graphical elements overlap?

2008-11-03 Thread Johannes Graumann
Thank very much for this very cool help! Joh Greg Snow wrote: > There is also the spread.labs function in the TeachingDemos package that > uses a different method from the plotrix function and should not move any > labels that are not overlapping. There are also the dynIdentify and > TkIdentify

Re: [R] a nlm question

2008-11-03 Thread Gabor Grothendieck
Read the last line on every message to r-help and particularly the part about providing reproducible examples. On Mon, Nov 3, 2008 at 8:10 AM, Jiang Peng <[EMAIL PROTECTED]> wrote: > Dear R listers, > >I posted this problem several days ago but it seems nobody answered. > >I use nlm to op

[R] standard errors for predict.nls?

2008-11-03 Thread Christoph Scherber
Dear all, Is there a way to retrieve standard errors from nls models? The help page tells me that arguments such as se.fit are ignored... Many thanks and best wishes Christoph -- Dr. rer.nat. Christoph Scherber University of Goettingen DNPW, Agroecology Waldweg 26 D-37073 Goettingen Germa

[R] Returning a vector from by

2008-11-03 Thread Daniel Brewer
Hello, I am trying to return a vector from a simply by but I cannot get it working, even using simplify=TRUE. res <- data.frame(ID=c("a","a","a","b","b"),Score=c(0,1,2,0,1)) yoda <- by(res$Score,res$ID,max,simplify=T) class(yoda) [1] "by" I would like it to return a vector with the names as the

Re: [R] Fourier Transform with irregularly spaced x

2008-11-03 Thread stephen sefick
You need to decide how you are going to interpolate the values. Look at the zoo package- na.approx() . spectrum() take the x axis and produces a power spectrum vs. cycles/time. you may interpret this however it makes ssnse- if it makes sense. On Mon, Nov 3, 2008 at 4:23 AM, Claudia Beleites <[

[R] quantcut

2008-11-03 Thread Kåre Edvardsen
I'm trying to devide x into tertiles, but ends up with integer limits even x holds one decimal. The analysis is extremely sensitive to the limits and I like to keep them right. How can that be done? quartiles <- quantcut( x[x >= 0], q=seq(0,1, by=(1/3)) > table(quartiles) quartiles [180,344] (344,

Re: [R] How to detect NULL list element?

2008-11-03 Thread Erik Iverson
FYI, this is FAQ 7.1 Wacek Kusnierczyk wrote: Barry Rowlingson wrote: 2008/11/3 <[EMAIL PROTECTED]>: So how do I detect the NULL at r[1]? How can you detect what is not there? Single square brackets on a list give you a list. Double square brackets give you the elements. is.nul

Re: [R] quantcut

2008-11-03 Thread Prof Brian Ripley
On Mon, 3 Nov 2008, Kåre Edvardsen wrote: I'm trying to devide x into tertiles, but ends up with integer limits even x holds one decimal. The analysis is extremely sensitive to the Do you mean integer character representations in the labels? See ?cut and argument 'dig.lab'. What you actuall

Re: [R] How to detect NULL list element?

2008-11-03 Thread Wacek Kusnierczyk
Erik Iverson wrote: > FYI, this is FAQ 7.1 ... which says what you should and should not do, but without any a justification for the design. coherently, x[i] = list(NULL) should do the same as x[[i]] = NULL, if only for symmetry with x[i] = list(1) and x[[1]] = 1, for example. vQ > > Wacek Kusn

Re: [R] standard errors for predict.nls?

2008-11-03 Thread Ben Bolker
Christoph Scherber agr.uni-goettingen.de> writes: > > Dear all, > > Is there a way to retrieve standard errors from nls models? > The help page tells me that arguments > such as se.fit are ignored... > > Many thanks and best wishes > Christoph I have written some reasonably generic delta-

Re: [R] Help with 'annotation' in GOHyperGParamsClass

2008-11-03 Thread James W. MacDonald
Hi Jason, There is a listserv dedicated to Bioconductor packages; I suggest you post there. [EMAIL PROTECTED] Best, Jim Jason Myers wrote: Dear cateGOry experts, hyperGTest documentation states that YEAST cannot be used as 'annotation' when evaluating gene ontology representation status

Re: [R] qr() and Gram-Schmidt

2008-11-03 Thread Peter Dalgaard
cruz wrote: > Hi, > > Why the qr() produces a negative Q compared with Gram-Schmidt? (note > example below, except Q[2,3]) This is a recurrent question in various guises (related to sign issues in factor analysis and PCA). Probably the easiest answer is "Why not?". Notice that at each step of Gra

Re: [R] standard errors for predict.nls?

2008-11-03 Thread Christian Ritz
Dear Christoph, using the package 'alr3' it's not difficult! Have a look at the following example: ## Fitting a Michaelis-Menten model Puromycin.m1<-nls(rate~a*conc/(b+conc), data=Puromycin[1:12,], start=list(a=200, b=1)) library(alr3) ## Predictions (with standard errors) at concentrations 0

Re: [R] Sweave: side by side dynamic graphs

2008-11-03 Thread Felipe Carrillo
Thanks Dieter, I didn't know about 'minipage' but I was actually going to try par'(mfrow=c(1,2))' this morning. Thanks for your help again. --- On Sun, 11/2/08, Dieter Menne <[EMAIL PROTECTED]> wrote: > > I'm trying to create some side by side dynamic > graphics on the same page but > > Than

Re: [R] Fourier Transform with irregularly spaced x

2008-11-03 Thread Ben Bolker
> Claudia Beleites units.it> wrote: > > Searching for discrete fourier transform I found lots of information and > > functions - but I didn't see anything that just works > > with irregularly spaced > > signals: all functions I found take only the signal, not its x-axis. > > > > Where should I l

[R] Calculating R2 for a unit slope regression

2008-11-03 Thread J. Sebastian Tello
Does anyone know of a literature reference, or a piece of code that can help me calculate the amount of variation explained (R2 value), in a regression constrained to have a slope of 1 and an intercept of 0? Thanks! Sebastian J. Sebastián Tello Department of Biological Sciences 285 Life Sci

[R] NaN causes "error in fitter" with cph.calibrate from pkg Design

2008-11-03 Thread David Winsemius
I have been attempting to use cph models to get better calibration of my models for which I had originally used logistic regression. I tried running with 40 repetitions and got an error. I then tried 500 repetitions (thinking that the NaNs in the output below might be caused by that choic

[R] dev2bitmap: extra missing

2008-11-03 Thread Ido M. Tamir
Hi, I don't know if I am the first one to report the problem: in 2.8.0 dev2bitmap gained aa support, but "extra" is null if neither taa nor naa is specified. > dev2bitmap("plot.pdf",type="pdfwrite") Error in paste(shQuote(gsexe), " -dNOPAUSE -dBATCH -q -sDEVICE=", type, : object "extra" not fo

Re: [R] how to store lme/lmer fit result

2008-11-03 Thread Christoph Scherber
Dear Julia, I think the best thing to do is to save your workspace, including all your objects. This works conveniently using the drop-down menu on Windows. Alternatively, you can use sink(), for example using the Windows clibboard: sink("clipboard") summary(...) # your object(s) here sink()

[R] Component merge in hclust objects

2008-11-03 Thread Agustin Lobo
Having a non-standard problm of clustering, I'm making an "ad-hoc" procedure in R but would like my object to be a list like the one produced by hclust. I have a doubt regarding component merge: While the meaning of the negative elements is clear, I'm confused about the next sentence in the hclu

Re: [R] Fourier Transform with irregularly spaced x

2008-11-03 Thread Claudia Beleites
> Try http://finzi.psych.upenn.edu/R/library/nlts/html/spec.lomb.html or > http://finzi.psych.upenn.edu/R/library/cts/html/spec.ls.html (do > RSiteSearch("Lomb periodogram") -- > the Lomb periodogram does a discrete (although not fast) Fourier > transform of unevenly sampled (1D/time-series) data

Re: [R] Fourier Transform with irregularly spaced x

2008-11-03 Thread stephen sefick
neat. I learn something everyday On Mon, Nov 3, 2008 at 11:01 AM, Claudia Beleites <[EMAIL PROTECTED]> wrote: >> Try http://finzi.psych.upenn.edu/R/library/nlts/html/spec.lomb.html or >> http://finzi.psych.upenn.edu/R/library/cts/html/spec.ls.html (do >> RSiteSearch("Lomb periodogram") -- >> the

Re: [R] Returning a vector from by

2008-11-03 Thread ronggui
If you just want that result, you can try tapply instead of by. > tapply(res$Score,res$ID,max) a b 2 1 On Mon, Nov 3, 2008 at 7:31 PM, Daniel Brewer <[EMAIL PROTECTED]> wrote: > Hello, > > I am trying to return a vector from a simply by but I cannot get it > working, even using simplify=TRUE. > >

Re: [R] standard errors for predict.nls?

2008-11-03 Thread Prof Brian Ripley
On Mon, 3 Nov 2008, Ben Bolker wrote: Christoph Scherber agr.uni-goettingen.de> writes: Dear all, Is there a way to retrieve standard errors from nls models? The help page tells me that arguments such as se.fit are ignored... Many thanks and best wishes Christoph I have written some rea

Re: [R] how to store lme/lmer fit result

2008-11-03 Thread Douglas Bates
On Thu, Oct 9, 2008 at 8:51 PM, liujb <[EMAIL PROTECTED]> wrote: > Dear R users, > I am building a hierarchical model on a large data set. It can take quite > some time to finish one fit, I was just wondering whether it is possible to > store the fit object (the result) to a file for later (offli

[R] Multiple plots on multiple devices

2008-11-03 Thread Oliver Kimberlin
Hi List, This is possibly a newbie error. I have however searched long and hard and haven't found a solution. I am attempting to plot multiple lattice graphs in R, plotting 4 per page and moving on to a new device to plot the next 4 and so on. (I want to do this in R and not export to a pdf etc)

[R] map geographical boundaries

2008-11-03 Thread Yogesh Tiwari
Hello, I want to crate a blanck geographical map showing continent boundary of region: latitude = -5:35 longitude = 35:100 If we create data like: lat= -5,0,5,10,.. long=35,40,45,50,. Then how to map (long,lat) and create a map plot. Many thanks, Yogesh [[alternative HTML

[R] How do you apply a function to each variable in a data frame?

2008-11-03 Thread zerfetzen
I want to apply a more complicated function than what I use in my example, but the idea is the same: Suppose you have a data frame named x and you want to a function applied to each variable, we'll just use the quantile function for this example. I'm trying all sorts of apply functions, but not

[R] Input correlation matrix directly to princomp, prcomp

2008-11-03 Thread EVANS David-William
Hello fellow Rers, I have a no-doubt simple question which is turning into a headache so would be grateful for any help. I want to do a principal components analysis directly on a correlation matrix object rather than inputting the raw data (and specifying cor = TRUE or the like). The re

Re: [R] R newbie: how to replace string/regular expression

2008-11-03 Thread Krishna Dagli
On Mon, Nov 3, 2008 at 3:36 AM, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > I did provide a link to that solution already but also wanted to > show how to do it in the same way that the code in the question > was written. Thanks for pointing me in right direction, both solutions are wonderful.

Re: [R] dev2bitmap: extra missing

2008-11-03 Thread Prof Brian Ripley
Apparently so: this will be fixed in R-patched shortly. Thanks for the report. On Mon, 3 Nov 2008, Ido M. Tamir wrote: Hi, I don't know if I am the first one to report the problem: in 2.8.0 dev2bitmap gained aa support, but "extra" is null if neither taa nor naa is specified. dev2bitmap("plot

Re: [R] How do you apply a function to each variable in a data frame?

2008-11-03 Thread Jorge Ivan Velez
Dear zerftezen, Try this: # Data set.seed(123) X=as.data.frame(matrix(rnorm(100),ncol=10)) # Percentiles 10 and 90 using apply t(apply(X,2,quantile,probs=c(0.1,0.9))) # The same using sapply t(sapply(X,function(x) quantile(x,probs=c(0.1,0.9 HTH, Jorge On Mon, Nov 3, 2008 at 10:03 AM, z

[R] a nlm question

2008-11-03 Thread Jiang Peng
Dear R listers, I posted this problem several days ago but it seems nobody answered. I use nlm to optimize a given function ,but it always generates the following warnings " Error in nlm(foo, theta.start) : non-finite value supplied by 'nlm' " I don't know why ,can anyb

Re: [R] Multiple plots on multiple devices

2008-11-03 Thread Prof Brian Ripley
On Mon, 3 Nov 2008, Oliver Kimberlin wrote: Hi List, This is possibly a newbie error. I have however searched long and hard and haven't found a solution. I am attempting to plot multiple lattice graphs in R, plotting 4 per page and moving on to a new device to plot the next 4 and so on. (I wan

Re: [R] need some help

2008-11-03 Thread bartjoosen
see ?merge Kurapati, Ravichandra (Ravichandra) wrote: > > Hi , > > > >> df > > Session_Setup DCT FwdDataVols_bin countsComp > > 1 User_Initiated NoRLL 1 5058 User_Initiated+NoRLL+1 > > 2 User_Initiated NoRLL 2584 U

Re: [R] How do you apply a function to each variable in a data frame?

2008-11-03 Thread hadley wickham
On Mon, Nov 3, 2008 at 9:02 AM, Jorge Ivan Velez <[EMAIL PROTECTED]> wrote: > Dear zerftezen, > Try this: > > # Data > set.seed(123) > X=as.data.frame(matrix(rnorm(100),ncol=10)) > > # Percentiles 10 and 90 using apply > t(apply(X,2,quantile,probs=c(0.1,0.9))) > > # The same using sapply > t(sapply

Re: [R] Input correlation matrix directly to princomp, prcomp

2008-11-03 Thread Prof Brian Ripley
On Mon, 3 Nov 2008, EVANS David-William wrote: Hello fellow Rers, I have a no-doubt simple question which is turning into a headache so would be grateful for any help. I want to do a principal components analysis directly on a correlation matrix object rather than inputting the raw data (a

Re: [R] How to detect NULL list element?

2008-11-03 Thread rkevinburton
Thank you for the input. The FAQ indicates: How can I set components of a list to NULL? I wanted to detect if an element is NULL or missing. I have come up with a work-around that seems to work. Maybe others will have a better way: if(length(rlist) < index || is.null(rlist[[index]

Re: [R] R newbie: how to replace string/regular expression

2008-11-03 Thread Gabor Grothendieck
On Mon, Nov 3, 2008 at 11:51 AM, Krishna Dagli <[EMAIL PROTECTED]> wrote: > I have one doubt though, how does one locate packages that's > available for specific task (like this one). Does one look at package > index (http://cran.cnr.berkeley.edu/web/packages/index.html). > or is there any other tr

Re: [R] How do you apply a function to each variable in a data frame?

2008-11-03 Thread Carlos J. Gil Bellosta
Data frames are lists themselves. Something like do.call( rbind, lapply( my.data.frame, quantile, probs=c(0.1,0.9)) ) should work. Carlos J. Gil Bellosta http://www.datanalytics.com On Mon, 2008-11-03 at 07:03 -0800, zerfetzen wrote: > I want to apply a more complicated function than what I u

[R] question about .Machine

2008-11-03 Thread Erin Hodgess
Dear R People: How do you find out about some of the components in the .Machine function, please? In particular, the double.ulp.digits and the double.neg.ulp.digits, please? thanks, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston

[R] Please ignore previous .Machine question

2008-11-03 Thread Erin Hodgess
I found it. Right in the help file. Sorry. e -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: [EMAIL PROTECTED] __ R-help@r-project.org mailing list https://stat.ethz.ch/m

Re: [R] How do you apply a function to each variable in a data frame?

2008-11-03 Thread Erik Iverson
zerfetzen wrote: I want to apply a more complicated function than what I use in my example, but the idea is the same: Suppose you have a data frame named x and you want to a function applied to each variable, we'll just use the quantile function for this example. I'm trying all sorts of apply

[R] descretizing xy data

2008-11-03 Thread Jon A
Hello, I have a dataset with a continuous independent variable (fish length, range: 30-150 mm) and a binary response (foraging success, 0 or 1). I want to discretize fish length into 5 mm bins and give the proportion of individuals who successfully foraged in each each size bin. I have used the cu

Re: [R] descretizing xy data

2008-11-03 Thread Erik Iverson
Jon - Jon A wrote: Hello, I have a dataset with a continuous independent variable (fish length, range: 30-150 mm) and a binary response (foraging success, 0 or 1). I want to discretize fish length into 5 mm bins and give the proportion of individuals who successfully foraged in each each size bi

[R] Re : panel data & maximum likelihood function

2008-11-03 Thread justin bem
see plm, or lmer packages Justin BEM BP 1917 Yaoundé Tél (237) 99597295 (237) 22040246 De : Migle Purzelyte <[EMAIL PROTECTED]> À : r-help@r-project.org Envoyé le : Lundi, 3 Novembre 2008, 0h26mn 21s Objet : [R] panel data & maximum likelihood function

[R] How to calculate modulus of complex number

2008-11-03 Thread Bogaso
suppose I have following complex number : a = -0.0475983+0.5364486i This number I got as an eigen value of a matrix. Now I would like to calculate the Modulus of this complex number. Is there any function for doing that? Regards, -- View this message in context: http://www.nabble.com/How-to-

Re: [R] [Pls ignore] How to calculate modulus of complex number

2008-11-03 Thread Bogaso
Well, I got a function Mod() for doing that. Bogaso wrote: > > suppose I have following complex number : > > a = -0.0475983+0.5364486i > > This number I got as an eigen value of a matrix. > > Now I would like to calculate the Modulus of this complex number. Is there > any function for doing

Re: [R] map geographical boundaries

2008-11-03 Thread Ray Brownrigg
It's not clear exactly what you want, but try something like: library(maps) map("world", xlim=c(35, 100), ylim=c(-5, 35), interior=FALSE) lat= c(-5,0,5,10) long=c(35,40,45,50) points(long, lat, col=2) HTH, Ray Brownrigg On Tue, 04 Nov 2008, Yogesh Tiwari wrote: > Hello, > I want to crate a bla

Re: [R] [Pls ignore] How to calculate modulus of complex number

2008-11-03 Thread Henrique Dallazuanna
Or abs(a) On Mon, Nov 3, 2008 at 4:47 PM, Bogaso <[EMAIL PROTECTED]> wrote: > > Well, I got a function Mod() for doing that. > > > Bogaso wrote: > > > > suppose I have following complex number : > > > > a = -0.0475983+0.5364486i > > > > This number I got as an eigen value of a matrix. > > > > Now

Re: [R] ESS Toolbar missing after Ubuntu Update

2008-11-03 Thread Martin Maechler
Hi Andreas, > "AW" == Andreas Wittmann <[EMAIL PROTECTED]> > on Sun, 2 Nov 2008 01:44:58 -0800 (PST) writes: AW> Dear R useRs, yesterday i updated my system from ubuntu AW> 8.04 to 8.10. I use emacs- snapshot, this is emacs AW> 23.0.60.1 and ess 5.3.8. I think R-help is n

Re: [R] Calculating R2 for a unit slope regression

2008-11-03 Thread Charles C. Berry
On Mon, 3 Nov 2008, J. Sebastian Tello wrote: Does anyone know of a literature reference, or a piece of code that can help me calculate the amount of variation explained (R2 value), in a regression constrained to have a slope of 1 and an intercept of 0? Sebastien, In the future, please foll

Re: [R] R newbie: how to replace string/regular expression

2008-11-03 Thread Charles C. Berry
On Mon, 3 Nov 2008, Krishna Dagli wrote: On Mon, Nov 3, 2008 at 3:36 AM, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: I did provide a link to that solution already but also wanted to show how to do it in the same way that the code in the question was written. Thanks for pointing me in right

Re: [R] Kalman Filter

2008-11-03 Thread Giovanni Petris
> Date: Fri, 31 Oct 2008 16:39:32 +0100 > From: Sandrine LUNVEN <[EMAIL PROTECTED]> > Sender: [EMAIL PROTECTED] > Importance: Normal > Precedence: list > > > Hi, > > I am studying Kalman Filter and it seems to be difficult for me to apply the > filter on a simple ARMA. > It is easy to construct

Re: [R] Calculating R2 for a unit slope regression

2008-11-03 Thread Rolf Turner
On 4/11/2008, at 4:30 AM, J. Sebastian Tello wrote: Does anyone know of a literature reference, or a piece of code that can help me calculate the amount of variation explained (R2 value), in a regression constrained to have a slope of 1 and an intercept of 0? The question is ``wrong''.

[R] Unexpected behavior of difftime in relationship to daylight savings time

2008-11-03 Thread Dennis Fisher
Colleagues, I just encountered some unexpected behavior of difftime in relationship to the change from daylight savings to standard time. My understanding is that DST and ST take effect at 2AM. However, the code below suggests that R (version 2.8.0 in OS X) implements the change at 2:16A

Re: [R] Splitting device for ggplots?

2008-11-03 Thread Jim Price
You could write a function to get rid of a lot of the grunt work; for example (this using lattice instead of ggplot, but should be pretty much the same): library(lattice) library(grid) graphics.off() myPlot1 <- xyplot(1 ~ 1 | 1) myPlot2 <- xyplot(2 ~ 2 | 2) myPlot3 <- xyplot(3 ~ 3 | 3) myPlot

Re: [R] How do you apply a function to each variable in a data frame?

2008-11-03 Thread zerfetzen
Thank you all for the help, sometime soon I'll know enough to be able to help others who are learning this. Thanks. -- View this message in context: http://www.nabble.com/How-do-you-apply-a-function-to-each-variable-in-a-data-frame--tp20304332p20308611.html Sent from the R help mailing list arc

Re: [R] sampling from Laplace-Normal

2008-11-03 Thread Murray Jorgensen
Hi Armin, Laplace-Normal random variables may be generated as the sum of a Normal rv and the difference of two exponential rvs. See Reed, W.J. and Jorgensen, M.A. (2004) The Double Pareto-Lognormal distribution – A new parametric model for size distributions. Communications in Statistics B:

Re: [R] descretizing xy data

2008-11-03 Thread Jon A
Thanks a lot Eric, that worked great. Sorry about not posting the data. Jon Jon A wrote: > > Hello, > I have a dataset with a continuous independent variable (fish length, > range: 30-150 mm) and a binary response (foraging success, 0 or 1). I want > to discretize fish length into 5 mm bins and

Re: [R] standard errors for predict.nls?

2008-11-03 Thread Ben Bolker
Prof Brian Ripley wrote: >> Christoph Scherber agr.uni-goettingen.de> >> writes: >> >>> >>> Dear all, >>> >>> Is there a way to retrieve standard errors from nls models? >>> The help page tells me that arguments >>> such as se.fit are ignored... >>> >>> Many thanks and best wishes >>> Christoph >

[R] Extract Residual Variance from lmer using VarCorr

2008-11-03 Thread Benjamin Michael Kelcey
I am trying to extract the residual variance from an lmer object. I have tried using VarCorr() which allows me to see the estimate but can not save it by itself. How can I get this from VarCorr() or is there another function available for this? Thanks, ben _

[R] IWLS vs direct ML estimation

2008-11-03 Thread sandsky
Hi, I am thinking about IWLS vs ML estimation. When I use glm() for a 2-parameter distribution (e.g., Weibull), I can otain the MLE of scale parameter given shape parameter through IWLS. Because this scale parameter usually converges to the MLE. In this point, I am wondering: i) can you say th

[R] heatmap.2 question

2008-11-03 Thread Fu Sheng
Hi, there, I am planning to use heatmap.2 function to draw some heatmaps. However, I don't want to use default set manhattan distance and complete linkage in heatmap.2. How should I change parameters distfun and hclustfun? Thank you. ys [[alternative HTML version deleted]] _

[R] strange list structure question

2008-11-03 Thread markleeds
my problem is more complex than below but I think below can suffice. i have a list and the name of it at the top level is GGG. so, if i do an lapply and operate on lower components in the sublist, then I can do as shown in EXAMPLE 1 and what will come back will be named GGG at the top level.

[R] regex question

2008-11-03 Thread Ferry
hello, i am trying to extract text using regex as follows: "* < <* this is my text > > " into: "this is my text" below what I did: varReg <- "* < <* this is my text > > " ## either this pattern patReg <- "(^[ <*]+)" ## or below patten patReg <- "([ > ]+$)" sub(patReg, '', varReg) dependi

Re: [R] regex question

2008-11-03 Thread Gabor Grothendieck
If patReg1 and patReg2 are your two regex's then: gsub(paste(patReg1, patReg2, sep = "|"), "", varReg) On Mon, Nov 3, 2008 at 8:37 PM, Ferry <[EMAIL PROTECTED]> wrote: > hello, > > i am trying to extract text using regex as follows: > > "* < <* this is my text > > " > > into: > > "this is my

Re: [R] regex question

2008-11-03 Thread John Fox
Dear Ferry, You're almost all the way there. Just apply each substitution in turn: varReg <- "* < <* this is my text > > " left <- "(^[ <*]+)" right <- "([ > ]+$)" sub(right, "", sub(left, "", varReg)) [1] "this is my text" I hope this helps, John -- John Fox, Prof

[R] Combining many files into one

2008-11-03 Thread t c
I have a few hundred .csv files in a folder on my hard drive, and I would like to combine them all into one file.  They are all the same data, but the program that collected the data saved a file every 4 hours.  I can combine the files one at a time using rbind, but am having a problem automatin

Re: [R] strange list structure question

2008-11-03 Thread markleeds
Hi Rolf: it's not what's inside the lapplys that i was interested in which probably made my question more confusing. all i was trying to show was that, in EXAMPLE 1, the name comes back at the top level of the result. in EXAMPLE 2, i can use the name GGG inside the lapply functon to do whate

Re: [R] Combining many files into one

2008-11-03 Thread jim holtman
The error message might mean that you have an empty file. It is probably better to use a list for reading in the data and then combine them at the end. "try" may also catch your errors: all.dat <- lapply(list.files(mydir), function(.file){ try(read.csv(.file)) }) all.dat <- do.call(rbind, al

Re: [R] strange list structure question

2008-11-03 Thread Charles C. Berry
On Mon, 3 Nov 2008, [EMAIL PROTECTED] wrote: Hi Rolf: it's not what's inside the lapplys that i was interested in which probably made my question more confusing. all i was trying to show was that, in EXAMPLE 1, the name comes back at the top level of the result. in EXAMPLE 2, i can use the n

[R] getting "small" graphs with Sweave using Rnews.sty

2008-11-03 Thread Jeff Hamann
I'm sorry for having to post this, but I can't seem to find any solutions to this, which seems pretty simple, but then again... I've started playing with the example r news project and wanted to start adding some graphs, but replacing: \begin{figure} \vspace*{.1in} \framebox[\textwidth]{\hfil

Re: [R] strange list structure question

2008-11-03 Thread Deepayan Sarkar
On 11/3/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > my problem is more complex than below but I think below can suffice. i have > a list and the name of it at the top level is GGG. so, if i do an lapply > and operate on lower components in the sublist, then I can do as shown in > EXAMPLE 1

[R] ordered logistic regression of survey data with missing variables

2008-11-03 Thread Thomas Soehl
Hello: I am working with a stratified survey dataset with sampling weights and I want to use multiple imputation to help with missingness. 1. Is there a way to run an ordered logistic regression using both a multiply imputed dataset (i.e. from mice) and adjust for the survey characteristics

Re: [R] ordered logistic regression of survey data with missing variables

2008-11-03 Thread Stas Kolenikov
Thomas, You might want to read this first: http://www.citeulike.org/user/ctacmo/article/1269394. And this, too: http://www.citeulike.org/user/ctacmo/article/637812. On 11/3/08, Thomas Soehl <[EMAIL PROTECTED]> wrote: > Hello: > I am working with a stratified survey dataset with sampling weights

Re: [R] regex question

2008-11-03 Thread Ferry
Dear John, Gabor ... Thank you for your fast responses. In term of efficiency, does my code efficient? I mean, I thought there is a way to combine both patterns into a single line. Also, I tried to substitute the pattern ([ <*]+) with ([[:punct:]]), as in R regex docs: patReg1 <- "(^[[:punct:]]+)

Re: [R] regex question

2008-11-03 Thread markleeds
Hi: Gabor's solution does do it in a single line. he just used paste to make the line. see below. John's is sort of a single line also but he called sub twice. I doubt that it's possible to make it shorter than those solutions. # Gabor's solution spelled out. patReg1 <- "(^[ <*]+)" patReg2 <

[R] [OT] factorial design

2008-11-03 Thread Edna Bell
Dear R Gurus: I vaguely remember reading that if interaction was present in a factorial design, then the main effect results were suspect. However, I was reading a text which now uses the tests for main effects even if interaction is present. Which is correct, please? Thanks, Edna Bell ___

[R] R 2.8.0 compilation...

2008-11-03 Thread jiapei100
R Compilation... Postby jiapei on Tue Nov 04, 2008 2:06 am Not sure whether this is important for R... checking dl.h usability... no checking dl.h presence... no checking for dl.h... no checking floatingpoint.h usability... no checking floatingpoint.h presence... no checking for floatingpoint

[R] problem with plot style (pch) with lattice in legend

2008-11-03 Thread PALMIER Patrick - CETE NP/INFRA/TRF
Hello, I'm doing xyplot(s) with groups using the following code and "lattice" package xyplot(V8 ~ V7 | cut(V17,c(0,10,20,100),include.lowest=T )+cut(V18,c(0,10,20,100),include.lowest=T ), pch=20,groups=as.array(c("HPM","HPS","HCJ","HCN")[V19]),data=A1,auto.key=list(space="bottom",pch=20,po

[R] Spatstat - Birth Death Process Simulation

2008-11-03 Thread maud
Hello, I would like to use the spatstat package to generate realizations from a spatial birth death process. The death rate is dependent on the pairwise interaction function. 1 - I'd like to know how to define my own interaction potential function 2 - I'm not sure which model to use for a birth d

Re: [R] problem with plot style (pch) with lattice in legend

2008-11-03 Thread Felix Andrews
instead of pch = 20, try par.settings = simpleTheme(pch = 20) 2008/11/4 PALMIER Patrick - CETE NP/INFRA/TRF <[EMAIL PROTECTED]>: > Hello, > > > I'm doing xyplot(s) with groups using the following code and "lattice" > package > > xyplot(V8 ~ V7 | cut(V17,c(0,10,20,100),include.lowest=T > )+cut(

Re: [R] Multiple plots on multiple devices

2008-11-03 Thread Felix Andrews
Hi Oliver, These are my suggestions... Option 1: use the playwith package (a GTK+ interface); Option 2: use the latticist package (a gWidgets interface, will be released in the next day or two); Option 3: use this code: plotOnePage <- function(x, page, ...) { stopifnot(inherits(x, "trelli

Re: [R] Error : unable to restore saved data in .RData"

2008-11-03 Thread megh
I have got one post here http://tolstoy.newcastle.edu.au/R/help/04/10/5221.html here it is suggested to start R with a flag --no-restore-data . Can anyone please tell me how to start R like that? megh wrote: > > I am getting error "unable to restore saved data in .RData", whenever I > start R

[R] multiple agreement plots on a single device?

2008-11-03 Thread FD
Hi All: Has anyone used the function agreementplot in the vcd package? Now I want to put more than 1 plots on a single device. I tried par(mfrow), split.screen() and layout(), but with no luck. Below is a sample code. mydata <- data.frame(rater1=sample(1:2, 10, replace=T),

[R] Error : unable to restore saved data in .RData"

2008-11-03 Thread megh
I am getting error "unable to restore saved data in .RData", whenever I start R console. I have reinstalled R with latest version but still getting same error. Once I click "OK" the R window crashes. Can anyone suggest me about the courses to do? Regards, -- View this message in context: http:/