search for: 1.414214

Displaying 20 results from an estimated 38 matches for "1.414214".

2003 Oct 30
0
dist() objects with NA's don't print them (PR#4866)
The print.dist() method in the mva package currently prints the triangular distance matrices with the ``trick'' of setting the (diagonal and) upper triangular part to NA, and then uses print(mat, na = "") to print that matrix. This is very much undesired if there are true NAs. Reproducible example code: (x <- cbind(c(1,NA,2,3), c(NA,2,NA,1))) (d <- dist(x)) ## does not
2012 Jun 20
1
prcomp: where do sdev values come from?
In the manual page for prcomp(), it says that sdev is "the standard deviations of the principal components (i.e., the square roots of the eigenvalues of the covariance/correlation matrix, though the calculation is actually done with the singular values of the data matrix)." ?However, this is not what I'm finding. ?The values appear to be the standard deviations of a reprojection of
2006 Aug 16
1
help about agnes
Hello. I have the following distance matrix between 8 points: [1,] 0.000000 3.162278 7.280110 8.544004 7.071068 9.899495 6.403124 8.062258 [2,] 3.162278 0.000000 5.000000 6.403124 4.472136 8.944272 6.082763 8.062258 [3,] 7.280110 5.000000 0.000000 1.414214 1.000000 5.000000 4.242641 5.830952 [4,] 8.544004 6.403124 1.414214 0.000000 2.236068 4.123106 4.472136 5.656854 [5,] 7.071068 4.472136
2001 May 16
2
Strange formatting
I've never noticed this before, though it's probably not new. In 1.2.3 for Windows, if I print a short vector the formatting is different than if I print a long one, whether or not they fit on one line. The short/long split appears to be between 9 and 10 elements: > 1:9 [1] 1 2 3 4 5 6 7 8 9 > 1:10 [1] 1 2 3 4 5 6 7 8 9 10 > sqrt(1:9) [1] 1.000000 1.414214
2013 Dec 12
2
method default for hclust function
I could not figure out what was the default when I ran hclust() without specifying the method. For example: I just have a code like: hclust(dist(data)) Any input would be appreciated:) [[alternative HTML version deleted]]
2004 Mar 11
1
how to pass extra parameters using call() or similar mechanism ?
I am trying to write a function, which would allow to call various methods and would pass to them extra arbitrary parameters. My first attempt was to use call() as illustrated below, but apparently '...' cannot be used in such context. How can this be achieved ? Best regards, Ryszard > myfun <- function(method, x, ...) { + v <- eval(call(method, x, ...)) + } > method =
2015 Mar 25
2
nested parallel workers
Hi Simon, I'm having trouble with nested parallel workers, specifically, forking inside socket connections. When mclapply is called inside a SOCK, PSOCK or FORK worker I get an error in unserialize(). cl <- makeCluster(1, "SOCK") fun = function(i) { library(parallel) mclapply(1:2, sqrt) } Failure occurs after multiple calls to clusterApply: > clusterApply(cl, 1,
2007 Aug 16
1
Question on output of vectors from a for loop into a matrix
Hello R-help, I am a recent convert to R from SAS and I am having some difficulty with output of a for loop into a matrix. I have searched the help manuals and the archives, but I can't get my code to work. It is probably a syntax error that I am not spotting. I am trying to make a distance matrix by extracting the distances from each point to all others in a vector (the for loop). I can
2015 Mar 30
2
nested parallel workers
On 03/25/2015 07:48 PM, Simon Urbanek wrote: > On Mar 25, 2015, at 3:46 PM, Valerie Obenchain <vobencha at fredhutch.org> wrote: > >> Hi Simon, >> >> I'm having trouble with nested parallel workers, specifically, forking inside socket connections. >> > > You simply can't by definition - when you fork *all* the workers share the same connection
2009 Nov 20
3
help me avoid nested for() loops!
Hi R folks, I have a massive array (object name "points") in the following form [,1] [,2] [1,] 1369 22 [2,] 1370 22 [3,] 1368 23 [4,] 1369 23 [5,] 1370 23 [6,] 1371 23 (10080 rows truncated) These represent pixel coordinates of interest in a jpeg image. I need to find the distance from each point to all other points of interest. The only way I can see to do this
2000 May 15
1
pythag missing in src/appl/ROUTINES (PR#544)
Full_Name: Roger Bivand Version: 1.0.1 OS: Linux RH 6.1 Submission from: (NULL) (158.37.102.52) I am trying to use pythag() from src/appl in a .Call() function. pythag seems to be missing from the ROUTINES list in appl - putting it in solved the problem: > x <- 1 > y <- 1 > sqrt(x^2 + y^2) [1] 1.414214 > dyn.load("pythagtry.so") Error in dyn.load(x,
2012 Feb 26
1
Matrix problem to extract animal associations
Dear List, I have been trying to extract associations from a matrix whereby individual locations are within a certain distance threshold from one another. I have been able to extract those individuals where there is 'no interaction' (i.e. where these individuals are not within a specified distance threshold from another individual) and give these individuals a unique Group ID containing
2015 Mar 26
0
nested parallel workers
On Mar 25, 2015, at 3:46 PM, Valerie Obenchain <vobencha at fredhutch.org> wrote: > Hi Simon, > > I'm having trouble with nested parallel workers, specifically, forking inside socket connections. > You simply can't by definition - when you fork *all* the workers share the same connection inherited from the parent, so you cannot use any I/O operations that you
2010 Mar 02
1
capturing errors in Sweave
Hi, I'm writing a manual using Sweave and I want to be able to print errors from bad code. Here's an example: <Function-4a>>= MySqrt <- function(x) { if (missing(x)) { stop("'x' is missing with no default") } if (!is.numeric(x)) { stop("'x' should only be numeric") } if (x < 0) { stop("'x' should be
2010 Dec 07
0
R programing help-newton iterations for the square root
From: jypuppy36@hotmail.com To: r-help-bounces@r-project.org Subject: R programing help-newton iterations for the square root Date: Tue, 7 Dec 2010 12:00:01 -0800 NEWTON ITERATIONS FOR THE SQUARE ROOT Newton iterations to find the root of a real valued function f , i.e. a number x for which f (x) = 0, are of the form Example. To find the square root of a positive number y we can use
2002 Aug 05
2
options(digits) (PR#1879)
[this message needed manual improvement by the mailing list administrator since it was `HTMLified' .. ``please do not''] Apologies for bothering you about a fairly trivial matter. I have been getting some inconsistencies with the display digits in R V1.5. I have been using the hypergeometric distribution function, and have found that when printing out the results from this
2012 Mar 19
5
Output formatting in Latex and R
I am working on Latex and R and using following code. <<echo=FALSE>>= infile<-read.table("test.txt",sep="\t") Col3 <- unique(infile[,3]) LCol3 <- length(Col3) for (i in 1:LCol3) { print(paste("Column", Col3[i])) print(infile[infile[,3]==Col3[i],-3]) } @ I am getting following output. 1] "Column C" V1 V2 V4 1 A B D 2 X T K [1]
2015 Mar 30
0
nested parallel workers
On Mar 30, 2015, at 4:40 PM, Valerie Obenchain <vobencha at fredhutch.org> wrote: > On 03/25/2015 07:48 PM, Simon Urbanek wrote: >> On Mar 25, 2015, at 3:46 PM, Valerie Obenchain <vobencha at fredhutch.org> wrote: >> >>> Hi Simon, >>> >>> I'm having trouble with nested parallel workers, specifically, forking inside socket connections.
2009 Jul 20
2
I might be dumb : a simple question about "foreach"
Hi list, My attention was drawn to the foreach package by recent posts...I decided to have a look... I'm using R.2.9.1 on Windows, I have downloaded the foreach package today (v 1.2.1), together with iterators (v. 1.0.1) and codetools (v.0.2-2). Full of hope I try the most simple thing of all out of the package vignette : > x <- foreach(i = 1:3) %do% sqrt(i) and get : > Erreur
2004 Apr 27
4
Problems raised to 1/3 power and NaN
I am debugging some code and found a function that returns and error most of the time. I have issolated the problem to when it raises an argument to the 1/3 power but for the life of me I can not figure out why it is not working. i have gone through the FAQs and have found nothing (not to say I might have missed something). I am highly embarrased with my inability find the problem (my face is