Re: [R] What am I doing wrong with this loop ?

2011-03-03 Thread eric
Never mind Billgot it. Always seems to happen this way. Can't figure something out. Post to the site and wham, 5 min later (after posting), it's all clear. Oh well, thanks for the tips -- View this message in context: http://r.789695.n4.nabble.com/What-am-I-doing-wrong-with-this-loop-tp3332

[R] Problems with a function warning

2011-03-03 Thread Luis Felipe Parra
Hello. I have the following funtion: fechasEntrega = function(FechasEntrega,fecha){ if(length(which(FechasEntrega0){ tkmessageBox(title = "Error en Fecha de Valoracion",message="Hay una fecha de entrega anterior a la fecha de valoracion. Todas las fechas de entrega deben ser posteriores

Re: [R] Problems with a function warning

2011-03-03 Thread Joshua Wiley
Dear Felipe, I did not have any difficulty with it using: R version 2.12.1 (2010-12-16) Platform: i386-pc-mingw32/i386 (32-bit) locale: [1] LC_COLLATE=English_United States.1252 [2] LC_CTYPE=English_United States.1252 [3] LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C [5] LC_TIME=Englis

Re: [R] Floating points and floor() ?

2011-03-03 Thread David Winsemius
On Mar 3, 2011, at 8:23 PM, Folkes, Michael wrote: Perhaps somebody could clarify for me if the following is a floating point matter or otherwise, and how am I to correct for it? floor(100*.1) [1] 10 100*(1.0-.9) [1] 10 floor(100*(1-0.9)) [1] 9 Yes. It's a "floating point matter".

Re: [R] R: Help center

2011-03-03 Thread David Winsemius
On Mar 3, 2011, at 5:10 PM, > wrote: I also would like to stop the mailing, without unsubscribing myself from the help center. How can I proceed?Thanks All of the options for your subscription are changed on the same webpage. -- David. Lorenza __

Re: [R] Floating points and floor() ?

2011-03-03 Thread Jeff Newmiller
You are assuming that 0.1 is exactly represented. Since it is not, either 0.1 or 1-0.9 will be less than 0.1. As to what you should do about it... that depends on what you are trying to accomplish. Whatever it is, you need to use some other approach. Often the alternative involves using integer

Re: [R] Floating points and floor() ?

2011-03-03 Thread rex.dwyer
Hi Michael, In floating point calculation, 1.0-.9 is not exactly 0.1. This is easily seen by subtracting. > (1.0-.9)-0.1 [1] -2.775558e-17 > (1.0-.9)==0.1 [1] FALSE David is right, you can't "correct" this. You can only compensate by taking care that you never, ever test whether 2 FP numbers

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

2011-03-03 Thread tingtingzhan
Hi All, I'm experiencing difficulties in saving a model fit by gls(). Basically if I just save() a gls object "gls.fit" in my workspace into an .RData file and later reload this .RData file, I get error when running script such as summary(gls.fit)$coefficients Dr. Bates's reply (quoted below)

Re: [R] PCA - scores

2011-03-03 Thread William Revelle
Shari, Josh partly answered your question, but his example did not include rotation because he took out just one factor. Try: require(psych) mt.pc <- principal(mtcars,3,scores=TRUE) #this gives you the varimax rotated first 3 principal components #pc.scores <- mt.pc$scores #here are

[R] questions about using loop, while and next

2011-03-03 Thread Carrie Li
Hello R helpers, I have a quick question about loop and next In my loop, I have some random generation of data, but if the data doesn't meet some condition, then I want it to go next, and generate data again for next round. # just an example.. # i want to generate the data again, if the sum is s

[R] advice on classes/methods/extending classes

2011-03-03 Thread Erin Hodgess
Dear R People: What is the best way to learn about classes, methods, extending classes, and namespaces, please? I know a bit about classes, but would like to learn much more. Thanks in advance for any advice! Sincerely, Erin -- Erin Hodgess Associate Professor Department of Computer and Math

Re: [R] advice on classes/methods/extending classes

2011-03-03 Thread Joshua Wiley
Hi Erin, One good option would be the official manual: http://cran.r-project.org/doc/manuals/R-exts.html It depends to an extent, I think, on what types of methods you would like to work with and use. FWIW, I have and really enjoy both S Programming by Venables & Ripley (mostly S3 methods and ge

[R] How two compare two matrixes

2011-03-03 Thread Alaios
Dear all I have two 10*10 matrixes and I would like to compare theirs contents. By the word content I mean to check visually (not with any mathematical formulation) how similar are the contents. I also know edit that prints my matrix in the scree but still one edit blocks the prompt to launch a

<    1   2