Re: [R] how to get the row name?

2006-01-30 Thread Antonio, Fabio Di Narzo
2006/1/30, Ionut Florescu [EMAIL PROTECTED]: I don't know about rownames but x = 0 gives you a vector of logical values True and false. If then you do c(1:length(x)) [x=0] this gives the positions where the true happened, meaning your vector of values. But also returns NA's, if present in

Re: [R] Logistic regression model selection with overdispersed/autocorrelated data

2006-01-30 Thread Frank E Harrell Jr
[EMAIL PROTECTED] wrote: I am creating habitat selection models for caribou and other species with data collected from GPS collars. In my current situation the radio-collars recorded the locations of 30 caribou every 6 hours. I am then comparing resources used at caribou locations to

Re: [R] Type II SS for fixed-effect in mixed model

2006-01-30 Thread Peter Dalgaard
Martin Julien [EMAIL PROTECTED] writes: Hi In mixed-model with lme() How can I obtain Type II SS or Type III SS for fixed effect? Thanks Julien You don't want that (look up suitable sermon by Bill Venables in the archives). Single-term Wald tests, however, are available using the syntax

[R] predict.lme / nlmmPQL: non-conformable arguments

2006-01-30 Thread David Reitter
I'm trying to use predict with a linear mixed-effects logistic regression model fitted with nlmmPQL from the MASS library. Unfortunately, I'm getting an error non-conformable arguments in predict.lme, and I would like to understand why. I have used the same call to predict with glm models

Re: [R] RMySQL install

2006-01-30 Thread Peter Dalgaard
Michaell Taylor [EMAIL PROTECTED] writes: I am having trouble installing RMySQL on a clean install of Fedora Core 4 64 bit on a dual dual core machine (that is, two dual core processors). Seems like the LD_LIBRARY_PATH is incorrect, but I don't seem to have it quite right yet. There

Re: [R] matlab-like constant matrix initialization?

2006-01-30 Thread Michael
Honestly this is the most creative method I've seen. Thank you for giving me courage to continue exploring R... I had almost decided to give up feeling that the language is so inconvinient and counter-intuitive. On 1/30/06, Gabor Grothendieck [EMAIL PROTECTED] wrote: Do you mean they are in

Re: [R] matlab-like constant matrix initialization?

2006-01-30 Thread Michael
No I don't want to adapt them manually by adding , and format them by hand... that's tedious and daunting... you cannot just paste it, you have to adapt it either like this x - matrix( c( 1.2, 3.4, 1.4, 2.3, 3.7, 2.6 ), nrow = 2, byrow = TRUE) or

[R] testing the signifiance of variables in a robust regression with M-estimators

2006-01-30 Thread Nicolas Ferrari
Hello, I have computed robust regressions with M-estimator using rlm(). The score function used is psi(x)=c*x/(x^2+c). Distributions are highly concentrated and have very thick tails. I have not introduced fixed effects because the important number of observations could make numerical

Re: [R] collating columns

2006-01-30 Thread Dave Roberts
You can just use data.frame(). If (using your example) your dataframes are called first and second, your could new - dataframe(first$A,second$Z,first$B,second$Y,first$C,second$X...) followed by names(new) - c('A','Z','B','Y','C','X') If you have an enormous number of columns that's a pain,

Re: [R] RMySQL install

2006-01-30 Thread David James
Michaell Taylor wrote: I am having trouble installing RMySQL on a clean install of Fedora Core 4 64 bit on a dual dual core machine (that is, two dual core processors). Seems like the LD_LIBRARY_PATH is incorrect, but I don't seem to have it quite right yet. There are a few mentions

[R] Sweave: trouble controlling Design package startup output

2006-01-30 Thread Paul Johnson
Hello, everybody: I'm experimenting more with Sweave, R, and LyX. There's now an entry in the LyX wiki on using R, so anybody can do it! http://wiki.lyx.org/LyX/LyxWithRThroughSweave Now I notice this frustrating thing. I think I've done everything possible to make the Design library start up

Re: [R] Loops that last for ever...

2006-01-30 Thread Constantine Tsardounis
Thank you very very much for your responses... How exactly do I vectorize? One example could be the following, that calculates the sums 1:5, 2:6, 3:7,..., for each of xs[[i]] : xs - lapply(1:500, function(x) rnorm(1000)) totalsum - list() sums - list() first - list() for(i in

Re: [R] Sweave: trouble controlling Design package startup output

2006-01-30 Thread Frank E Harrell Jr
Paul Johnson wrote: Hello, everybody: I'm experimenting more with Sweave, R, and LyX. There's now an entry in the LyX wiki on using R, so anybody can do it! http://wiki.lyx.org/LyX/LyxWithRThroughSweave Now I notice this frustrating thing. I think I've done everything possible to make

Re: [R] Loops that last for ever...

2006-01-30 Thread Constantine Tsardounis
Thank you very much!!! It works!.. I will try your philosophy to my script!... xs - lapply(1:500, function(x) rnorm(1000)) result - lapply(xs, function(.val){ .total - sum(.val) # total sum .sums - filter(.val, rep(1,5)) # sum 5 consective values list(total=.total,

Re: [R] Glossay of available R functions

2006-01-30 Thread Patricia J. Hawkins
ASA == Alexandre Santos Aguiar [EMAIL PROTECTED] writes: ASA I am new to R and read this list to learn. It is amazing how ASA frequently new functions pop in messages. Useful and timesaving ASA functions like subset (above) must be documented somewhere. ASA Is there a glossary of functions?

Re: [R] Date Not Staying in Date Format

2006-01-30 Thread Don MacQueen
Try following this example: foo - Sys.time() class(foo) [1] POSIXt POSIXct ick - as.numeric(foo) ick [1] 1138667199 class(ick) [1] numeric class(ick) - class(foo) ick [1] 2006-01-30 16:26:39 PST -Don At 3:51 PM -0500 1/30/06, David Randel wrote: I have a column in a data frame

[R] lattice: combining panel.xyplot with panel.abline - is this possible?

2006-01-30 Thread Søren Højsgaard
Consider this data frame: dat-data.frame(id=gl(3,5),time=rep(1:5,3),cm1=rep(c(2,3,4),each=5),cm2=rep(c(2.5,3.5,4.5),each=5),y=rnorm(15)) dat id time cm1 cm2 y 1 11 2 2.5 -1.0824549 2 12 2 2.5 -0.7784834 3 13 2 2.5 -1.7783560 4 14 2 2.5 0.5056637 5

[R] lme in R (WinXP) vs. Splus (HP UNIX)

2006-01-30 Thread Greg Tarpinian
R2.2 for WinXP, Splus 6.2.1 for HP 9000 Series, HP-UX 11.0. I am trying to get a handle on why the same lme( ) code gives such different answers. My output makes me wonder if the fact that the UNIX box is 64 bits is the reason. The estimated random effects are identical, but the fixed effects

Re: [R] How do I normalise a power spectral density analysis?

2006-01-30 Thread Spencer Graves
Since I have not seen a reply to this post, I will offer a comment, even though I have not used spectral analysis myself and therefore have you intuition about it. First, from the definitions I read in the results from, e.g., RSiteSearch(time series power spectral density) [e.g.,

Re: [R] Date Not Staying in Date Format

2006-01-30 Thread Gabor Grothendieck
Using this test data, say: dd - Sys.Date() + 0:9 fac - gl(5,2) Try this: do.call(c, tapply(dd, fac, max, simplify = FALSE)) or if a list result is ok then just tapply(dd, fac, max, simplify = FALSE) Another possibility using the as.Date.numeric method in the zoo package is:

Re: [R] yet another vectorization question

2006-01-30 Thread Patricia J. Hawkins
AD == Adrian Dusa [EMAIL PROTECTED] writes: AD set.seed(5) AD aa - matrix(sample(10, 15, replace=T), ncol=5) AD bb - matrix(NA, ncol=10, nrow=5) AD for (i in 1:ncol(aa)) bb[i, aa[, i]] - c(0, 1, 0) AD Is there any possibility to vectorize this for loop? AD (sometimes I have hundreds of columns

[R] Announce: Contributed Documentation

2006-01-30 Thread Vincent Goulet
[Version française plus bas] To the R community, A quick word to announce the publication of my document Introduction à la programmation en S. It is available in the French section of the Contributed Documentation page of CRAN. Many of the documents or books currently available on S-Plus and/or

Re: [R] Complex Matrix Exponentials.

2006-01-30 Thread Spencer Graves
Thank you very much for providing a concrete, simple, reproducible example illustrating your question. Without it, it would be much more difficult for me to understand your question and respond appropriately. I know this is generally a very hard problem, and I've seen come

Re: [R] yet another vectorization question

2006-01-30 Thread Gabor Grothendieck
On 1/30/06, Patricia J. Hawkins [EMAIL PROTECTED] wrote: AD == Adrian Dusa [EMAIL PROTECTED] writes: AD set.seed(5) AD aa - matrix(sample(10, 15, replace=T), ncol=5) AD bb - matrix(NA, ncol=10, nrow=5) AD for (i in 1:ncol(aa)) bb[i, aa[, i]] - c(0, 1, 0) AD Is there any possibility to

Re: [R] Announce: Contributed Documentation

2006-01-30 Thread Wensui Liu
Vincent, I will be very much interested in the english version of your documentation! Thanks a lot! On 1/30/06, Vincent Goulet [EMAIL PROTECTED] wrote: [Version française plus bas] To the R community, A quick word to announce the publication of my document Introduction à la

Re: [R] handling NA by mean replacement

2006-01-30 Thread James Reilly
Here are a couple of documents that make much the same point (e.g. mean value imputation is not recommended), and discuss several alternatives. http://nces.ed.gov/statprog/2002/appendixb3.asp http://www2.chass.ncsu.edu/garson/pa765/missing.htm I think we'd need more information on the context

[R] Sos! Lines doesn't add plots to an existing plot...

2006-01-30 Thread Michael
I am lost: plot(testError, col=red) lines(testVar, col=black) Only one plot (the red one) appear on the Window, the black line did not appear...what's wrong? Thanks a lot! [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch

Re: [R] lattice: combining panel.xyplot with panel.abline - is thispossible?

2006-01-30 Thread Frede Aakmann Tøgersen
Well, one way to do it is xyplot(y~time|id, data=dat,type='l', panel=function(x,y,subscripts,...){ panel.xyplot(x,y,subscripts,...) panel.abline(v=dat[subscripts,cm1]) panel.abline(v=dat[subscripts,cm2]) } ) Since I don't know what the dataframe 'mergeData'

Re: [R] match() seq()

2006-01-30 Thread Jacques VESLOT
Thanks Roger, Andy and Dimitris... though i am familiar with this behaviour **in some cases**, i couldn't catch - yesterday evening - why it matched with 0.4, and not with 0.3; of course these numbers are not integers ! but i believed match() deals with such equalities. i will have a look at

Re: [R] Sos! Lines doesn't add plots to an existing plot...

2006-01-30 Thread Dieter Menne
Michael comtech.usa at gmail.com writes: plot(testError, col=red) lines(testVar, col=black) Only one plot (the red one) appear on the Window, the black line did not appear...what's wrong? We can only guess, because you did not supply the data. But I am quite sure, that the lines-data

Re: [R] Sos! Lines doesn't add plots to an existing plot...

2006-01-30 Thread Barry Rowlingson
Michael wrote: plot(testError, col=red) lines(testVar, col=black) Only one plot (the red one) appear on the Window, the black line did not appear...what's wrong? Hang on a second, just let me hack into your machine so I can find out what 'testError' and 'testVar' are I'm guessing

Re: [R] Sweave: trouble controlling Design package startup output

2006-01-30 Thread Dieter Menne
Paul Johnson pauljohn32 at gmail.com writes: echo=F,quiet=T,print=F= library(Design, verbose=F) at But in the output there is still one page of banner information, which starts like this: Loading required package: Hmisc Hmisc library by Frank E Harrell Jr Type library(help= Hmisc

Re: [R] Integer bit size and the modulus operator

2006-01-30 Thread Prof Brian Ripley
On Mon, 30 Jan 2006, Peter Dalgaard wrote: Ionut Florescu [EMAIL PROTECTED] writes: Actually it does that in my 2.2.1 version as well: options(digits=20) 8^(1:20) [1] 8.e+00 6.4004e+01 5.1201e+02 [4] 4.0961e+03 3.27680002e+04

Re: [R] Subsetting a matrix without for-loop

2006-01-30 Thread Petr Pikal
Hi matrix(colSums(embed(A,3)[1:3,]),3,6, byrow=T)[3:1,] [,1] [,2] [,3] [,4] [,5] [,6] [1,]6 33 60 87 114 141 [2,]9 36 63 90 117 144 [3,] 12 39 66 93 120 147 will do it. However I am not sure if it is quicker than your for loop. HTH Petr On 30 Jan 2006

Re: [R] Sos! Lines doesn't add plots to an existing plot...

2006-01-30 Thread Ted Harding
On 31-Jan-06 Michael wrote: I am lost: plot(testError, col=red) lines(testVar, col=black) Only one plot (the red one) appear on the Window, the black line did not appear...what's wrong? Thanks a lot! Check the ranges of values of your two variables (in both x and y directions in

<    1   2