similar to: Match .3 in a sequence

Displaying 20 results from an estimated 10000 matches similar to: "Match .3 in a sequence"

2009 Jun 08
4
seq(...) strange logical value
Do you heve any idea why I get after this instruction everywhere false? > seq (0, 1, by=0.1) == 0.3 [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE But after different step it's ok: > seq(0, 1, by=0.1) == 0.4 [1] FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE -- View this message in context:
2009 May 23
2
as.numeric(levels(factor(x))) may be a decreasing sequence
Function factor() in the current development version (2009-05-22) guarantees that levels are different character strings. However, they may represent the same decimal number. The following example is derived from a posting by Stavros Macrakis in thread "Match .3 in a sequence" in March nums <- 0.3 + 2e-16 * c(-2,-1,1,2) f <- factor(nums) levels(f) # [1]
2007 Sep 03
3
When 1+2 != 3 (PR#9895)
Full_Name: Marco Vicentini, University of Verona Version: 2.4.1 & 2.5.1 OS: OsX & WinXP Submission from: (NULL) (157.27.253.46) When I proceed to test the following equation 1 + 2 == 3, I obviously obtain the value TRUE. But when I tryed to do the same using real number (i.e. 0.1 + 0.2 == 0.3) I obtained an unusual FALSE. In the online help there are some tricks for this problem. It
2011 Mar 04
4
Floating points and floor() ?
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 Thanks! Michael _______________________________________________________ Michael Folkes Salmon Stock Assessment Canadian Dept. of Fisheries & Oceans Pacific Biological Station
2012 Sep 01
1
Vectorial analogue of all.equal()?
Greetings All. Once again, I am probably missing something fairly accessible, but since I can't find it I'd welcome advice! I have a dataframe derived from a text file of data in tabular format. For one of the variables, say X, I want to select the subsets which in which X equals a particular value. Such values are given in the text file like: 2.3978953, and each such value will occurr
2008 Apr 17
1
Suggestion: add a warning in the help-file of unique()
Hello I'm sorry if this suggestion/correction was already made but after a search in devel list I did not find any mention of it. I would just suggest to add a warning or an exemple for the help-file of the function unique() like "Note that unique() compares only identical values. Values which, are printed equally but in facts are not identical will be treated as different."
2007 Jan 17
2
Repeated measures
I am having a hard time understanding how to perform a "repeated measures" type of ANOVA with R. When reading the document found here: http://cran.r-project.org/doc/contrib/Lemon-kickstart/kr_repms.html I find that there is a reference to a function make.rm () that is supposed to rearrange a "one row per person" type of frame to a "one row per observation" type
2013 Jul 16
2
Problem following an R bug fix to integrate()
I have been told by the CRAN administrators that the following code generated an error on 64-bit Fedora Linux (gcc, clang) and on Solaris machines (sparc, x86), but runs well on all other systems): > fn <- function(x, y) ifelse(x^2 + y^2 <= 1, 1 - x^2 - y^2, 0) > tol <- 1.5e-8 > fy <- function(x) integrate(function(y) fn(x, y), 0, 1,
2012 Dec 19
2
create stratified splits
Hi, I have a vector like: r <- runif(100) Now I would like to split r into 10 pieces (each with 10 elements) ? but the 'pieces' should be roughly similar with regard to mean and sd. what is an efficient way to do this in R? thanks!
2010 Nov 28
5
unexpected behavior using round to 2 digits on randomly generated numbers
Hello! I stumbled upon something odd that took a while to track down, and I wanted to run it by here to see if I should submit a bug report. For randomly generated numbers (from a variety of distributions) rounding them to specifically 2 digits and then multiplying them by 100 produces strange results on about 8% of cases. The problematic numbers display as I would have expected, but do not
2007 Sep 03
2
Row-Echelon Form
I was looking for an R-package that would reduce matrices to row-echelon form, but Google was not my friend; any leads? If not, I wonder if the problem could be expressed in terms of constraint satisfaction...
2011 Aug 03
1
Case-by-case tolerance needed for successful integrate()
Hello, We are trying to use R to simulate a model based on parameters 'a' and 'b'. This involves the following integration: model<-function(s,x,a,b)(exp(-s*x*10^-5.5)*(s^(a-1)*(1-s)^(b-1))) g<- function(x,a,b){ out<-c() for (i in 1:length(x)){ out[i]<-1- (integrate(model,0,1,x[i],a,b)$value / beta(a,b)) } out } x<-
2020 Feb 08
4
Development version of R fails tests and is not installed
G'day all, I have daily scripts running to install the patched version of the current R version and the development version of R on my linux box (Ubuntu 18.04.4 LTS). The last development version that was successfully compiled and installed was "R Under development (unstable) (2020-01-25 r77715)" on 27 January. Since then the script always fails as a regression test seems to fail.
2017 Jun 22
2
Unexpected behaviour of base::qr()$rank
2017-06-22 19:49 GMT+02:00 Uwe Ligges <ligges at statistik.tu-dortmund.de>: > On 22.06.2017 17:11, Bernd Funovits wrote: >> >> Hello, >> >> I experienced some unexpected behaviour while determining the rank of matrices (sometimes 1x1 matrices): >> base::qr(matrix(1e-20))$rank returns 1 (incorrect) >> base::qr(diag(c(1, 1e-20)))$rank returns 2
2019 Mar 05
3
Development version of R fails tests and is not installed
G'day all, I have daily scripts running to install the patched version of the current R version and the development version of R on my linux box (Ubuntu 18.04.2 LTS). The last development version that was successfully compiled and installed was "R Under development (unstable) (2019-02-25 r76159)" on 26 February. Since then the script always fails as a regression test seems to
2008 May 01
4
efficient code - yet another question
Dear list members; The code given below corresponds to the PCA-NIPALS (principal component analysis) algorithm adapted from the nipals function in the package chemometrics. The reason for using NIPALS instead of SVD is the ability of this algorithm to handle missing values, but that's a different story. I've been trying to find a way to improve (if possible) the efficiency of the code,
2007 Jul 13
2
nearest correlation to polychoric
Dear all, Has someone implemented in R (or any other language) Knol DL, ten Berge JMF. Least-squares approximation of an improper correlation matrix by a proper one. Psychometrika, 1989, 54, 53-61. or any other similar algorithm? Best regards Jens Oehlschl?gel Background: I want to factanal() matrices of polychoric correlations which have negative eigenvalue. I coded Highham 2002
2010 Jun 25
1
variograms and kriging
Hello Trying to develop variograms and kriged surfaces from a point file. Here is what I've done so far. library(gstat) # also loads library(sp) library(lattice) soilpts$x <- soilpts$UTM_X soilpts$y <- soilpts$UTM_Y soil.dat <- subset(soilpts, select=c(x, y, Area, BulkDensity, LOI, TP, TN, TC, Total_Mg)) dim(soil.dat) [1] 1292 7 coordinates(soil.dat) <- ~ x+y
2015 Jul 30
1
all.equal: possible mismatch between behaviour and documentation
Dear Jon, thank you for raising the issue, >>>>> Jon Clayden <jon.clayden at gmail.com> >>>>> on Tue, 28 Jul 2015 12:14:48 +0100 writes: > Sorry; minor clarification. The actual test criterion in the example I > gave is of course abs((0.1-0.102)/0.1) < 0.01, not abs(0.1) < 0.01. In > any case, this does not match (my reading of) the docs,
2007 Jun 10
3
find position
find the position of the first value who equals certain number in a vector: Say a=c(0,0,0,0,0.2, 0.2, 0.4,0.4,0.5) i wish to return the index value in a for which the value in the vector is equal to 0.4 for the first time. in this case, it is 7. [[alternative HTML version deleted]]