similar to: problem with "which"

Displaying 20 results from an estimated 2000 matches similar to: "problem with "which""

2008 Dec 05
3
Logical inconsistency
Dear colleagues Please could someone kindly explain the following inconsistencies I've discovered when performing logical calculations in R: 8.8 - 7.8 > 1 > TRUE 8.3 - 7.3 > 1 > TRUE Thank you, Emma Jane [[alternative HTML version deleted]]
2008 Feb 12
4
0.45<0.45 = TRUE (PR#10744)
Dear developer, in my version of R (2.4.0) as weel as in a more recent version (2.6.0) on different computers, we found this problem : > a<-(58/40-1) > a [1] 0.45 > b<-(18/40) > b [1] 0.45 > a<b [1] TRUE > a==b [1] FALSE > Something seems wrong here. but if we do > c<-0.45 > d<-0.45 > c<d [1] FALSE then everything is ok. If we use 59
2008 Jun 12
4
problem with function "rep"
To whom it may concern, I am currently writing a program where I need to use function rep. The results I get are quite confusing. Given two vectors A and B, I want to replicate a[1] b[1] times, a[2] b[2] times and so on. All the entries of vector B are positive integers. My problem comes from the fact that if I sum up all the elements of B, I get a certain value x(for example 10000). And if
2009 Jul 23
2
Bug in seq() (PR#13849)
Full_Name: Jeremiah Cohen Version: 2.9.0 OS: Windows XP Submission from: (NULL) (129.59.230.235) I believe there is a bug in the seq() function for certain values of the "from" argument. Here are examples: > seq(-.2, .1, .1) [1] -0.2 -0.1 0.0 0.1 > seq(-.3, .1, .1) [1] -3.000000e-01 -2.000000e-01 -1.000000e-01 5.551115e-17 1.000000e-01 > seq(-.4, .1, .1) [1] -0.4 -0.3
2004 Sep 03
6
seq
Hi everyone, I've tried the below on R 1.9.1 and the 2004-08-30 builds of R 1.9.1 Patched and R 2.0.0 on Windows 2000, and the results are consistent. > seq(0.5, 0, by = -0.1) [1] 0.5 0.4 0.3 0.2 0.1 0.0 > seq(0.7, 0, by = -0.1) [1] 7.000000e-01 6.000000e-01 5.000000e-01 4.000000e-01 3.000000e-01 2.000000e-01 1.000000e-01 -1.110223e-16 Is this really the intended behaviour?
2007 Feb 25
1
Writing integers in "write.matrix" function
Hello everyone, I am using the following program to get the p-value of some numbers (column 'LR' of the data.dat file). I want to write the 1st and 2nd column of the output file (data.out) as an integer while the program change them. Could anybody please tell me how I can write the code which writes the values of the first two columns as integer? For your convenience, I have attached the
2007 Sep 21
1
Is it solve.QP or is it me?
Hi. Here are three successive examples of simple quadratic programming problems with the same structure. Each problem has 2*N variables, and should have a solution of the form (1/N,0,1/N,0,...,1/N,0). In these cases, N=4,5,6. As you will see, the N=4 and 6 cases give the expected solution, but the N=5 case breaks down. >cm8 [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1 0
2008 Mar 03
7
help for the first poster- a simple question
Hi, there, I cannot get accurate value for calculation. for example: ld<-sqrt(1*0.05*0.95*0.05*0.95) 0.05*0.95-ld=-6.938894e-18 0.05*0.95-ld==0 is False. I met this problem in my program, how can I handle it. Thanks. xj.
2009 Aug 01
5
incorrect result (41/10-1/10)%%1 (PR#13863)
Full_Name: jan hattendorf Version: 2.9.0 OS: XP Submission from: (NULL) (213.3.108.185) I get an incorrect result for (41/10-1/10)%%1 [1] 1 The error did not occur with other numbers than 41 (1, 11, 21, 31, 51, ...) test <- rep(NA, 1000) for(i in 1:1000){ test[i] <- i/10-1/10 } test[test%%1==0]
2007 May 30
1
Static and dynamic graphics course, July 2007, Salt Lake City
We're pleased to announce a one day course covering static and dynamic graphics using R, ggplot and GGobi. The course will be held just before the JSM, on Saturday, 28 July 2007, in Salt Lake City. The course will be presented by Dianne Cook and Hadley Wickham. In the course you will learn: * How to build presentation quality static graphics using the R package, ggplot. We will cover plot
2007 Nov 09
1
help with lasso2 package
X is a matrix and F is a vector. F2 <- data.frame(cbind(X,F)) F2 V1 V2 V3 F 1 -0.250536332 -1.4755883 1.9580974 -2.136487 2 -0.009856084 0.4953269 0.5486092 -2.744482 3 -0.406962682 0.7729631 0.1861905 -2.891821 4 1.938780097 0.7469251 1.2537781 -1.212992 5 -0.332370358 1.1943637 0.7114278 -1.830441 modF<-formula(F ~ V1 + V2 + V3) #no error message
2008 Jan 25
1
lapply without return values?
Hi I am looking for a function which is executing some code repeatedly, exactly like lapply() and sappl() are doing, but do not return anything as I am not interested in the return values. An example would be: > p <- data.frame(runif(10), runif(10), runif(10)) > lapply( p, function(ps) {x11(); plot(ps)} ) which results in three graphs and a printout: $runif.10. NULL $runif.10..1
2008 May 15
1
apply function
Hi R, Getting a strange result using ?apply. Please look into the below codes: > d=data.frame(a=c(1,2,3),b=c("A","B","C"),c=c(TRUE,FALSE,FALSE),d=c(T,F,F )) > class(d[,1]) [1] "numeric" > class(d[,2]) [1] "factor" > class(d[,3]) [1] "logical" > class(d[,4]) [1] "logical" >
2008 Oct 03
1
Bug or inaccuracy in cumsum( )
I came across this: shouldn't the last value be a more exact zero? It did not do that with 1 - sum( rep(0.1, 10) ) > 1 - cumsum( rep(0.1, 10) ) [1] 9.000000e-01 8.000000e-01 7.000000e-01 6.000000e-01 5.000000e-01 4.000000e-01 3.000000e-01 2.000000e-01 [9] 1.000000e-01 1.110223e-16 > version _ platform
2007 Jul 25
1
question on using "gl1ce" from "lasso2" package
Hi, I tried several settings by using the "family=gaussian" in "gl1ce", but none of them works. For the case "glm" can work. Here is the error message I got: > glm(Petal.Width~Sepal.Length+Sepal.Width+Petal.Length ,data=iris,family=gaussian()) > gl1ce(Petal.Width~Sepal.Length+Sepal.Width+Petal.Length ,data=iris,family=gaussian()) Error in eval(expr, envir,
2007 Nov 23
2
rbinom with computed probability
Hello, I have a loop with probability computed from a logistic model like this: for (i in 1:300){ p[i]<-exp(-0.834+0.002*x[i]+0.023*z[i])/(1+exp(-0.834+0.002*x[i]+0.023 +z[i])) x and z generated from normal distribution. I get 300 different probabilities And I want to generate variables from bernulli distribution with P for every observation: T[i]<-rbinom(1,1,p[i]) But i get missing
2008 Aug 24
1
Extracting formula from an lm object
I want to extra the part of the formula not including the response variable from an lm object. For example if the lm object ABx.lm was created by the call ABx.lm <- lm( y ~ A + B + x, ...) Then ACx.lm is saved as part of a workspace. I wish to extract "~ A + B + x". Later in my code I will fit another linear model of the form z ~ A + B + x for some other response variable z. I
2008 Apr 14
4
&& and ||
Hello there, I got a small problem about logical calculation: we can get a sequene from a+b as below: > a<-c(1,2) > b<-c(3,4) > a+b [1] 4 6 but when the sequences are logical. (I want to get (True,False) && (True, True) ==> (True, False), but when I do as below. > e<-c(T,T) > f<-c(F,T) > e [1] TRUE TRUE > f [1] FALSE TRUE >
2010 Jul 10
7
Need help on date calculation
Hi all, please see my code: > library(zoo) > a <- as.yearmon("March-2010", "%B-%Y") > b <- as.yearmon("May-2010", "%B-%Y") > > nn <- (b-a)*12 # number of months in between them > nn [1] 2 > as.integer(nn) [1] 1 What is the correct way to find the number of months between "a" and "b", still
2008 Feb 20
1
debugging a try() statement
Dear R Users, I implemented a try() statement that looks like: <- function(index) { reduced_model <- try(glm.fit(X4,n,family=poisson(link="log"))) full_model <- try(glm.fit(X5,n,family=poisson(link="log"))) if (inherits(reduced_model,"try-error") || inherits(full_model,"try-error")) return(NA) else { p <-