similar to: unexpected results in comparison (x == y)

Displaying 20 results from an estimated 10000 matches similar to: "unexpected results in comparison (x == y)"

2001 Nov 21
2
distances from points to line
Dear all, I have discovered that there are many things that I used to do in my GIS which are easily done directly in R, for example calculating interpoint distances using geoR and pick out points inside a polygon using splancs. I now wonder, is there a function to create a line object like a watercourse and then calculate the distances between many points in space and this line? I couldn't
2017 Oct 09
1
Using response variable in interaction as explanatory variable in glm crashes R
>>>>> Jan van der Laan <rhelp at eoos.dds.nl> >>>>> on Fri, 6 Oct 2017 12:13:39 +0200 writes: > It is actually model.matrix that crashes, not glm. Same > crash occurs with e.g. lm. > model.matrix(dob_mon ~ dob_day*dob_mon, data = tab) > also crashes R. Yes, segmentation fault. It only happens when these are *logical*
2008 Oct 25
1
pairwise.wilcox.test for paired samples
Dear R Core, pairwise.wilcox.test does not handle "paired = TRUE" correctly; e.g. set.seed(13) x <- rnorm(20) g <- c(rep(1, 10), rep(2, 10)) wilcox.test(x ~ g)$p.value # 0.075 pairwise.wilcox.test(x, g)$p.value # 0.075, o.k wilcox.test(x ~ g, paired = TRUE)$p.value # 0.105 pairwise.wilcox.test(x, g, paired = TRUE)$p.value # 0.075, wrong The line wilcox.test(xi, xj,
1999 Aug 05
1
pairwise scatterplot matrix
Dear Friends: I like so much to work with R program. Congratulations for your work. I need R for work with multivariate data. My question is: With the pairs(X) command my output is a pairwise scatterplot symmetric matrix. Like: | X1 |X1 vs X2|X1 vs X3|X1 vs X4| |X2 vs X1| X2 |X2 vs X3|X2 vs X4| |X3 vs X1|X3 vs X2| X3 |X3 vs X4| |X4 vs X1|X4 vs X2|X4 vs X3| X4 | It is
2010 Feb 11
1
Fwd: Recall function: "evaluation nested too deeply: infinite recursion / options(expressions=)?"
hello all i searched the archives and couldn't get a solution to the following question. i have the following function: F=function(z,v) { if (v==-.5) return(1) else return(2*v/z + 1/Recall(z,v-1)) } and while testing whether it works (ie F(z,v) is approx = besselK(z,1+v)/besselK(z,V). the recursion formula allows one to calculate besselK(z,1+v)/besselK(z,V) for large values of z )
2009 Oct 14
1
using mapply to avoid loops
Hello, I would like to use mapply to avoid using a loop but for some reason, I can't seem to get it to work. I've included copies of my code below. The first set of code uses a loop (and it works fine), and the second set of code attempts to use mapply but I get a "subscript out of bounds" error. Any guidance would be greatly appreciated. Xj, Yj, and Wj are also lists, and s2,
2006 Sep 01
1
integration problem with gamma function
Dear R-list members, I have a problem with translating a mathematica script into R. The whole script is at the end of the email (with initial values for easy reproduction) and can be pasted directly into R. The problematic part (which is included below of course) is <--- Original Mathematica ---> (* p_svbar *) UiA = Ni (Dsi - 2Di A + A^2)/2; UiiA = Nii (Dsii - 2Dii A + A^2)/2; psvbar =
2008 Jul 01
1
[.data.frame speedup
Below is a version of [.data.frame that is faster for subscripting rows of large data frames; it avoids calling duplicated(rows) if there is no need to check for duplicate row names, when: i is logical attr(x, "dup.row.names") is not NULL (S+ compatibility) i is numeric and negative i is strictly increasing "[.data.frame" <- function (x, i, j,
2004 May 24
1
as.matrix.data.frame() in R 1.9.0 converts to character when it should (?) convert to numeric
Conversion of a data frame to a matrix using as.matrix() when a column of the data frame is POSIXt and all other columns are numeric has changed in R 1.9.0 from R 1.8.1. The new behavior issues a warning message and converts to a character matrix. In R 1.8.1, such an object was converted to a numeric matrix. Here is an example. #### R 1.9.0 #### > foo <- data.frame(
2005 Sep 13
1
possible bug in model.matrix
Is this a bug, or have I misunderstood the proper use of lm? Thanks, Whit code: x <- rnorm(50) y <- matrix(as.logical(round(runif(100),0)),ncol=2) NROW(x)==NROW(y) lm(x~y) > x <- rnorm(50) > y <- matrix(as.logical(round(runif(100),0)),ncol=2) > NROW(x)==NROW(y) [1] TRUE > lm(x~y) Error in "[[<-.data.frame"(`*tmp*`, nn, value = c(2, 1, 2, 1, 1, 1, 2, :
2017 Dec 01
1
Bug is as.matrix.data.frame with nested data.frame
Converting a data.frame with a nested data.frame to a matrix fails: x <- structure(list(a = data.frame(letters)), class = "data.frame", row.names = .set_row_names(26)) as.matrix(x) #> Error in ncol(xj) : object 'xj' not found The offending code is here, in the definition of as.matrix.data.frame (source/base/all.R): for (j in pseq) {
2009 Oct 29
3
Weird error: Error in xj[i] : invalid subscript type 'list'
I got the error. I haven't been able to get a stand along case so that I can show it here. But could somebody give some clue on what could cause this error? Since I never defined xj[i], I don't understand where this error come from. Error in xj[i] : invalid subscript type 'list'
2017 Oct 06
2
Using response variable in interaction as explanatory variable in glm crashes R
The following code crashes R (I know I shouldn't try to estimate such a model; this was a bug in some code of mine). I also tried with R-devel; same result. tab <- structure(list(dob_day = c(FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE), dob_mon = c(FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE), dob_year = c(FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE), n =
2003 Jun 18
1
suggestion for make.names
I would like to suggest a modification to the make.names() function. The current implementation has two problems: 1. It doesn't check if a name matches an R keyword (like "function"). 2. The uniqueness algorithm is not invariant to concatenation. In other words, make.names(c("a","a","a"),unique=T) !=
2003 Jun 18
1
suggestion for make.names
I would like to suggest a modification to the make.names() function. The current implementation has two problems: 1. It doesn't check if a name matches an R keyword (like "function"). 2. The uniqueness algorithm is not invariant to concatenation. In other words, make.names(c("a","a","a"),unique=T) !=
2005 May 26
1
Simplify formula for heterogeneity
Dear R-ians, I'm looking for a computational simplified formula to calculate a measure for heterogeneity (let's say H ): H = sqrt [ (Si (Sj (Xi - Xj)?? ) ) /n ] where: sqrt = square root Si = summation over i (= 0 to n) Sj = summation over j (= 0 to n) Xi = element of X with index i Xj = element of X with index j I can simplify the formula to: H = sqrt [ ( 2 * n * Si (Xi) - 2 Si (Sj
2002 Oct 17
4
Multiple colors in plots/lookup function
Hello, I'd like to do something like: n<-100 zz<-cbind(rnorm(n),rnorm(n),floor(runif(n)*3+1)) colors<-c("red","green","blue") plot(zz,col=colors(zz[3])) and have a matrix of scatterplots colored by class. The above does not work, of course, but I'm not sure exactly what function I'm looking for. Thank you for your time, Dave, -- Dave
2007 Nov 30
0
Is there any multivariate regression function to combine all variables from a dataset?
Hi everybody, I've been looking for a function that combines all variables from a dataset because I need to do multivariate regression. If we have linear regression with an expression like f(x) = a0 + sum(ai*xi) what I want to do is something like f(x) = a0 + sum(ai*xi) + sum(sum(bij * xi * xj)) + sum(sum(sum(cijk*xi*xj*xk))) + ... So I need a function that combines all the values from
2010 Mar 26
2
R loop help
Hi, I am tring to write a loop to compute this, ========================== x1=c( rep(-1,4), rep(1,4) ) x2=c( rep(c(-1,-1,1,1),2) ) x3=c( rep(c(-1,1),4) ) x1*x2 x1*x3 x2*x3 ======================== suppose i have x1,x2,x3 i want to compute their ' two factor interactions', x1x2,x1x3 and x2x3, I wrote ======================== for(i in 1:2){ for( j in i+1:3){ xij=c()
2005 Aug 08
7
Loadbalancing and failover using TC and Iptables
Hi all iam trying to deploy loadbalance and failover My setup description --Fedora Core 4 --Linux 2.6.12.3 #1 SMP Mon Jul 25 22:37:34 IST 2005 i686 i686 i386 GNU/Linux --tc utility, iproute2-ss050314 --ip utility, iproute2-ss050314 --iptables v1.3.0 And i had deployed Following configuration #table main with priority 50, the highest one ip rule add prio 50 table main #table 201 ip rule add