Displaying 9 results from an estimated 9 matches for "1.732051".
Did you mean:
1.732051i
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
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
1999 Jun 30
1
qr and Moore-Penrose
> Date: Wed, 30 Jun 1999 11:12:24 +0200 (MET DST)
> From: Torsten Hothorn <hothorn at amadeus.statistik.uni-dortmund.de>
>
> yesterday I had a little shock using qr (or lm). having a matrix
>
> X <- cbind(1,diag(3))
> y <- 1:3
>
> the qr.coef returns one NA (because X is singular). So I computed the
> Moore-Penrose inverse of X (just from the
2004 Aug 30
3
Multiple lapply get-around
I am faced with a situation wherein I have to use multiple lapply's. The
pseudo-code could be approximated to something as below:
For each X from i=1 to n
For each Y based on j=1 to m
For each F from 1 to f
Do some calculation based on Fij
Store Xi,Yj = Fij
End For F
End for Y
End for X
Is there anyway to optimize the processing logic further? I *guess*
using the multiple lapply
2018 Mar 15
3
stats 'dist' euclidean distance calculation
Hello,
I am working with a matrix of multilocus genotypes for ~180 individual snail samples, with substantial missing data. I am trying to calculate the pairwise genetic distance between individuals using the stats package 'dist' function, using euclidean distance. I took a subset of this dataset (3 samples x 3 loci) to test how euclidean distance is calculated:
3x3 subset used
2009 Oct 16
1
Converting dataframe to matrix
Hi,
I'm experimenting with a few learners that require a matrix as their
input. (Currently svmpath, vbmp, etc.)
I currently have a dataframe with 50 columns and 20,000 rows.
I tried using:
x <- as.matrix(my_data.frame)
If I then as, "is.matrix(x)", I get TRUE.
However everywhere I've tried to use the matrix returns errors.
Is there a step I'm missing?
Thanks!
-N
2009 Mar 06
3
how to omit NA without using ifelse
I have a 50*50 matrix,some entry are NAs,I want to replace these NA by
0,so can I use some syntax to do so other than using ifelse?
I tried to use replace(a,NA,0),it didnt work~~(a is matrix name)
Thanks~
[[alternative HTML version deleted]]
2007 Oct 12
3
collapsing a data frame
Trying to find a quick/slick/easily interpretable way to
collapse a data set.
Suppose I have a data set that looks like this:
h <- structure(list(INDEX = structure(1:6, .Label = c("1", "2", "3",
"4", "5", "6"), class = "factor"), TICKS = c(0, 0, 0, 0, 0, 3
), BROOD = structure(c(1L, 1L, 2L, 3L, 3L, 3L), .Label =
2009 Jul 18
7
(-8)^(1/3) == NaN?
Why does the expression "(-8)^(1/3)" return NaN, instead of -2?
This is not answered by http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-are-powers-of-negative-numbers-wrong_003f
Thanks,
Dave
[[alternative HTML version deleted]]