Re: [R] "--" < 0

2024-06-25 Thread avi.e.gross
because of things like character strings that can be evaluated as numeric but may not be evaluated correctly if they are written in some way as in hexadecimal notation or scientific notation. -Original Message- From: R-help On Behalf Of Adrian Dusa Sent: Tuesday, June 25, 2024 4:59 AM To: Mar

Re: [R] "--" < 0

2024-06-25 Thread Adrian Dusa
Oh I see... It's not that "-7" gets coerced to numeric, but 0 gets coerced to "0". Of course... On Tue, Jun 25, 2024 at 11:02 AM Martin Maechler wrote: > > Adrian Dusa > > on Tue, 25 Jun 2024 10:56:07 +0300 writes: > > > Dear R fellows, > > >> From time to time, just when I

Re: [R] "--" < 0

2024-06-25 Thread peter dalgaard
Also notice that > "+5" < 0 [1] TRUE > as.numeric("+5") < 0 [1] FALSE So the presumption is wrong. It is really about > sort(c(0:3, "+", "-")) [1] "-" "+" "0" "1" "2" "3" -pd > On 25 Jun 2024, at 10:02 , Martin Maechler wrote: > >> Adrian Dusa >>on Tue, 25 Jun 2024 10:56:07

Re: [R] "--" < 0

2024-06-25 Thread Martin Maechler
> Adrian Dusa > on Tue, 25 Jun 2024 10:56:07 +0300 writes: > Dear R fellows, >> From time to time, just when I thought I knew my R, I get >> bitten by some > small things that reminds one to constantly return to the > basics. > I knew for instance that "-1"

[R] "--" < 0

2024-06-25 Thread Adrian Dusa
Dear R fellows, >From time to time, just when I thought I knew my R, I get bitten by some small things that reminds one to constantly return to the basics. I knew for instance that "-1" < 0 is TRUE, presumably because R first coerces to numeric before comparing with 0. But I did not expect that

Re: [R] 0 rows> (or 0-length row.names)

2016-08-31 Thread Shivi Bhatia
Thank you Mark & Dunlap, Will make changes to the variable as suggested. Thank you for your time & assistance. On Wed, Aug 31, 2016 at 9:16 PM, Mark Sharp wrote: > Shivi, > > Looking at the help from ?WOE, ?WOETable, and ?IV, your Y vector in all > cases is to be

Re: [R] 0 rows> (or 0-length row.names)

2016-08-31 Thread Mark Sharp
Shivi, Looking at the help from ?WOE, ?WOETable, and ?IV, your Y vector in all cases is to be categorical and it is numeric. Mark R. Mark Sharp, Ph.D. Director of Primate Records Database Southwest National Primate Research Center Texas Biomedical Research Institute P.O. Box 760549 San

Re: [R] 0 rows> (or 0-length row.names)

2016-08-31 Thread William Dunlap via R-help
I see the printout (not an "error") that you describe on the 2nd example you gave: > t2 <- WOETable(X=SFDC1$case_age, Y=SFDC1$survey) > print(t2) [1] GOODS BADS TOTAL PCT_G PCT_B WOE IV <0 rows> (or 0-length row.names) The result of WOETable is perfectly legal - it is a data.frame with no

Re: [R] 0 rows> (or 0-length row.names)

2016-08-31 Thread Shivi Bhatia
These are the packages i am using: library(woe) #WEIGHT OF EVIDENCE library(InformationValue) #INFORMATION VALUE The syntax used is : WOE(X=SFDC1$log_caseage, Y=SFDC1$survey) WOETable(X=SFDC1$case_age, Y=SFDC1$survey) IV(X=SFDC1$case_age, Y=SFDC1$survey) On Wed, Aug 31, 2016 at 12:54 AM, Mark

Re: [R] 0 rows> (or 0-length row.names)

2016-08-30 Thread William Dunlap via R-help
You need to show what R expressions you ran before running into this problem, including calls to library() or require(). Bill Dunlap TIBCO Software wdunlap tibco.com On Tue, Aug 30, 2016 at 12:15 PM, Shivi Bhatia wrote: > Hi Mark, > What i understand, probably when i run

Re: [R] 0 rows> (or 0-length row.names)

2016-08-30 Thread Mark Sharp
Shivi, What package(s) are you using. What functions are you using. How are you calling the functions. A reproducible sample has all of the actual code needed to create a representative error. There are multiple packages you could be using to look at weight of evidence and information value.

Re: [R] 0 rows> (or 0-length row.names)

2016-08-30 Thread Shivi Bhatia
Hi Mark, What i understand, probably when i run the WOE & IV to check significant variables that is where i get this error. Thanks for your assistance Mark really appreciate i will look into some other measure on this. On Wed, Aug 31, 2016 at 12:35 AM, Mark Sharp wrote: >

Re: [R] 0 rows> (or 0-length row.names)

2016-08-30 Thread Mark Sharp
Shivi, It is likely that William knows what you are trying to do because of his considerable experience, but I am not able to figure it out from what you have written. You have apparently sent the output from something like dput(SFDC[1:50, ]), but I still do not know what you did to get the

Re: [R] 0 rows> (or 0-length row.names)

2016-08-30 Thread Shivi Bhatia
Hi William/ Mark, I am using WOE & IV (weight of evidence) reduce the number of independent vars. I have read this data as a csv file. reproducible example for your reference please: structure(list(date = structure(c(6L, 6L, 6L, 6L, 6L, 6L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L,

Re: [R] 0 rows> (or 0-length row.names)

2016-08-30 Thread William Dunlap via R-help
You did not say what operation gave you the error. I can get that message (which is not an "error") if I print an illegally constructed data.frame, one without the row.names attribute. > illegalDF <- structure(class="data.frame", list(ColumnA = 1:3)) > illegalDF [1] ColumnA <0 rows> (or 0-length

Re: [R] 0 rows> (or 0-length row.names)

2016-08-30 Thread Mark Sharp
Shivi, Can you show the code that throws the error? <0 rows> (or 0-length row.names) Of course as always a reproducible sample would be great. Perhaps you can make a small subset of the data and use dput() to provide a defined object. R. Mark Sharp, Ph.D. Director of Primate Records Database

Re: [R] 0 rows> (or 0-length row.names)

2016-08-30 Thread Shivi Bhatia
Hi Mark, It gives me num [1:5083]. I have used head also to see first 10 obs: head(SFDC$case_age,10) [1] 24.84 0.05 13.38 0.15 11.11 4.16 8.13 0.07 3.61 0.00 Thanks. On Tue, Aug 30, 2016 at 10:05 PM, Mark Sharp wrote: > What do you get from > str(SFDC$case_age) >

Re: [R] 0 rows> (or 0-length row.names)

2016-08-30 Thread Mark Sharp
What do you get from str(SFDC$case_age) Mark R. Mark Sharp, Ph.D. Director of Primate Records Database Southwest National Primate Research Center Texas Biomedical Research Institute P.O. Box 760549 San Antonio, TX 78245-0549 Telephone: (210)258-9476 e-mail: msh...@txbiomed.org > On Aug

[R] 0 rows> (or 0-length row.names)

2016-08-30 Thread Shivi Bhatia
I know this question has been asked zillion times but even after consulting Stack Overflow & other forum cant figure out the reason. I have one var in my data-set names case age. This variable is numeric as: class(SFDC$case_age) *numeric* however it throws this error: <0 rows> (or 0-length

[R] 0^0 computation in R : Why it is defined 1 in R ?

2014-05-26 Thread ritwik_r
Dear R helpers, today I found something interesting in R. 0^0 gives value 1 in R. But it is undefined in mathematics. During debugging a R code, I found it and it effects my program severely. So my question is why it is defined 1 in R? Is there any particular reason or its a bug in the R

Re: [R] 0^0 computation in R : Why it is defined 1 in R ?

2014-05-26 Thread Prof Brian Ripley
On 26/05/2014 13:16, ritwi...@isical.ac.in wrote: Dear R helpers, today I found something interesting in R. 0^0 gives value 1 in R. But it is undefined in mathematics. During debugging a R code, I found it and it effects my program severely. So my question is why it is defined 1 in R

Re: [R] 0^0 computation in R : Why it is defined 1 in R ?

2014-05-26 Thread Jeff Newmiller
. Please excuse my brevity. On May 26, 2014 5:16:21 AM PDT, ritwi...@isical.ac.in wrote: Dear R helpers, today I found something interesting in R. 0^0 gives value 1 in R. But it is undefined in mathematics. During debugging a R code, I found it and it effects my program severely. So my question

Re: [R] 0^0 computation in R : Why it is defined 1 in R ?

2014-05-26 Thread David Winsemius
On May 26, 2014, at 9:42 AM, Prof Brian Ripley wrote: On 26/05/2014 13:16, ritwi...@isical.ac.in wrote: Dear R helpers, today I found something interesting in R. 0^0 gives value 1 in R. But it is undefined in mathematics. During debugging a R code, I found it and it effects my program

Re: [R] !0 + !0 == !0 - !0

2013-03-18 Thread Ben Bolker
Bert Gunter gunter.berton at gene.com writes: But this has nothing to do with 7.31 and everything to do with operator precedence and automatic casting from integers to logical and vice-versa. I also think it fair to say that all (??) languages have these sorts of malapropisms due to

Re: [R] !0 + !0 == !0 - !0

2013-03-18 Thread Charles Berry
Ben Bolker bbolker at gmail.com writes: Maybe FAQ 7.31 was referred to not for its direct relevance but as a measure of the old-hand-ness of the people who will get the joke. !1i|!0 Chuck __ R-help@r-project.org mailing list

Re: [R] !0 + !0 == !0 - !0

2013-03-18 Thread Sam Steingold
* Bert Gunter thagre.ore...@trar.pbz [2013-03-17 20:30:56 -0700]: I also think it fair to say that all (??) languages have these sorts of malapropisms due to operator precedence. Except for those languages which do _not_ have operator precedence. Like, e.g., Lisp. -- Sam Steingold

Re: [R] !0 + !0 == !0 - !0

2013-03-18 Thread Bert Gunter
Sam: Yes. Good point. (which is why my ?? was necessary). -- Bert On Mon, Mar 18, 2013 at 10:05 AM, Sam Steingold s...@gnu.org wrote: * Bert Gunter thagre.ore...@trar.pbz [2013-03-17 20:30:56 -0700]: I also think it fair to say that all (??) languages have these sorts of malapropisms

[R] !0 + !0 == !0 - !0

2013-03-17 Thread Charles Berry
Hi all, The subject line is TRUE. Today I accidentally typed rnorm(!0). My old eyes took a minute to focus clearly enough to see what I really typed and why I got '!0' random numbers instead of '10' random normal numbers. If the subject line is disturbing, be assured that this is TRUE:

Re: [R] !0 + !0 == !0 - !0

2013-03-17 Thread Patrick Burns
Chuck, What an absolutely wonderful R Infernoism. Pat On 18/03/2013 02:17, Charles Berry wrote: Hi all, The subject line is TRUE. Today I accidentally typed rnorm(!0). My old eyes took a minute to focus clearly enough to see what I really typed and why I got '!0' random numbers instead

Re: [R] !0 + !0 == !0 - !0

2013-03-17 Thread Bert Gunter
But this has nothing to do with 7.31 and everything to do with operator precedence and automatic casting from integers to logical and vice-versa. I also think it fair to say that all (??) languages have these sorts of malapropisms due to operator precedence. -- Bert On Sun, Mar 17, 2013 at

[R] 0 exit status on packages update try

2010-07-08 Thread stephen sefick
I am not entirely sure what is going on. I am sure that I am missing something. maptools won't detach... Thanks for all of your help. R 2.11.1 OS Ubuntu 10.04 R --vanilla install.packages(sp, dep=TRUE) Loading required package: reshape Loading required package: plyr Loading required

Re: [R] 0 x 0 matrix

2009-09-05 Thread Markku Karhunen
On 04-Sep-09 10:45:27, Markku Karhunen wrote: True. Should have read ?diag. However, this provokes a more general question: Is there some way I can declare some scalar and _all its functions_ as matrices? For instance, I would like to A = as.matrix(0.98) B = function(A) C = diag(sqrt(B))

Re: [R] 0 x 0 matrix

2009-09-05 Thread Ted Harding
On 05-Sep-09 10:00:26, Markku Karhunen wrote: On 04-Sep-09 10:45:27, Markku Karhunen wrote: True. Should have read ?diag. However, this provokes a more general question: Is there some way I can declare some scalar and _all its functions_ as matrices? For instance, I would like to A =

[R] 0 x 0 matrix

2009-09-04 Thread Markku Karhunen
Hi, Does anybody know, what is going on here? diag(sqrt(1)) [,1] [1,]1 diag(sqrt(0.)) 0 x 0 matrix sqrt(1) [1] 1 sqrt(0.) [1] 0.5773214 BR, Markku Karhunen researcher University of Helsinki __ R-help@r-project.org mailing

Re: [R] 0 x 0 matrix

2009-09-04 Thread Romain Francois
On 09/04/2009 12:25 PM, Markku Karhunen wrote: Hi, Does anybody know, what is going on here? diag(sqrt(1)) [,1] [1,] 1 diag(sqrt(0.)) 0 x 0 matrix sqrt(1) [1] 1 sqrt(0.) [1] 0.5773214 BR, Markku Karhunen researcher University of Helsinki Try this instead; diag(

Re: [R] 0 x 0 matrix

2009-09-04 Thread Duncan Murdoch
Markku Karhunen wrote: Hi, Does anybody know, what is going on here? diag( x ) produces a round(x) x round(x) identity matrix when x is length 1. (This is the third case listed on the man page ?diag). See the note there about a safer form if you wanted a matrix with x on the

Re: [R] 0 x 0 matrix

2009-09-04 Thread Barry Rowlingson
On Fri, Sep 4, 2009 at 11:25 AM, Markku Karhunenmarkku.karhu...@helsinki.fi wrote: Hi, Does anybody know, what is going on here? diag(sqrt(1))     [,1] [1,]    1 diag(sqrt(0.)) 0 x 0 matrix sqrt(1) [1] 1 sqrt(0.) [1] 0.5773214 Read the help for diag yet? 'diag'

Re: [R] 0 x 0 matrix

2009-09-04 Thread baptiste auguie
it's documented as unexpected ?diag Note Using diag(x) can have unexpected effects if x is a vector that could be of length one. Use diag(x, nrow = length(x)) for consistent behaviour. And the result follows from this part, else if (length(x) == 1L nargs() == 1L) { n -

Re: [R] 0 x 0 matrix

2009-09-04 Thread Duncan Murdoch
baptiste auguie wrote: it's documented as unexpected ?diag Note Using diag(x) can have unexpected effects if x is a vector that could be of length one. Use diag(x, nrow = length(x)) for consistent behaviour. And the result follows from this part, else if (length(x) == 1L nargs() == 1L)

Re: [R] 0 x 0 matrix

2009-09-04 Thread Duncan Murdoch
Duncan Murdoch wrote: baptiste auguie wrote: it's documented as unexpected ?diag Note Using diag(x) can have unexpected effects if x is a vector that could be of length one. Use diag(x, nrow = length(x)) for consistent behaviour. And the result follows from this part, else if

Re: [R] 0 x 0 matrix

2009-09-04 Thread Markku Karhunen
True. Should have read ?diag. However, this provokes a more general question: Is there some way I can declare some scalar and _all its functions_ as matrices? For instance, I would like to A = as.matrix(0.98) B = function(A) C = diag(sqrt(B)) so that all scalars are explicitly [1,1]

Re: [R] 0 x 0 matrix

2009-09-04 Thread Ted Harding
On 04-Sep-09 10:45:27, Markku Karhunen wrote: True. Should have read ?diag. However, this provokes a more general question: Is there some way I can declare some scalar and _all its functions_ as matrices? For instance, I would like to A = as.matrix(0.98) B = function(A) C =