similar to: Is there a faster way to do this?

Displaying 20 results from an estimated 10000 matches similar to: "Is there a faster way to do this?"

2009 Oct 28
1
Is there a faster way to do it?
#Mdarts is a matrix 2343x788 #frequencia is a vector 2343x1 # 9 in Mdarts[fri,frj] stands for my missing values which i want to replace by the value in the vector frequencia Mdarts<-t(matrix(scan("C:/GWS/CNB/dartg.txt"),ncol=nindT,nrow=nm, byrow=T)) frequencia <- matrix(scan("C:/GWS/CNB/freq.txt"),ncol=1) for (fri in 1:nindT){ for (frj in 1:nm){ Mdarts[fri,frj] <- if
2010 Mar 15
5
storing matrix(variables) in loop
Hello R-helpers, I have the following code that works well, b <-list() for (i in 1:3){ a <- matrix(runif(1),3,3) b[[i]] <- a } b however, I need to do something similar with two loops and I was looking for something that would look like b <- list() for (i in 1:3){ for (j in 1:4){ a <- matrix(runif(1),3,3) b[[i,j]] <- a #but this doesn?t work } } Anyway, I wanted
2009 Dec 01
3
Using two (...) in a function
Hello R-Helpers, I am not sure if it is a very simple question but I would like to use two (...) in a function, for example, this is a script where I would like to input the variable names (in one of the (...)) and the variances associated to those variables which are not calculated in the script because there is a specific software to calculate it (the other (...)) data <- function
2009 Sep 17
3
How to separate a function by 2 probabilities
Good Mourning, I have a function to generate a matrix as I show part of it; g[j,i]<-if (gen[j,i]==0) al1[i,1]+al1[i,1] else ... However i would like that this function occurred with a probability P and that another function (another formula to generate g matrix) with probability P-1 That?s it, if P is .7, i would like that in 70% of the times (for random i and j) the matrix g was generated
2003 Jun 08
2
LDA: normalization of eigenvectors (see SPSS)
Hi dear R-users I try to reproduce the steps included in a LDA. Concerning the eigenvectors there is a difference to SPSS. In my textbook (Bortz) it says, that the matrix with the eigenvectors V usually are not normalized to the length of 1, but in the way that the following holds (SPSS does the same thing): t(Vstar)%*%Derror%*%Vstar = I where Vstar are the normalized eigenvectors. Derror
2005 Oct 19
3
diag() problem
Hi I have a matrix "u", for which diag() gives an error: u <- structure(c(5.42334674128216, -2.31319389204264, -5.83059042218476, -1.64112369640695, -2.31319389212801, 3.22737617646609, 1.85200668021569, -0.57102273078531, -5.83059042231881, 1.85200668008156, 11.9488923894962, -3.5525537165941, -1.64112369587405, -0.571022730886046, -3.55255371755604,
2009 Oct 22
1
data frame is killing me! help
Usage data(gasoline) Format A data frame with 60 observations on the following 2 variables. octane a numeric vector. The octane number. NIR a matrix with 401 columns. The NIR spectrum and I see the gasoline data to see below NIR.1686 nm NIR.1688 nm NIR.1690 nm NIR.1692 nm NIR.1694 nm NIR.1696 nm NIR.1698 nm NIR.1700 nm 1 1.242645 1.250789 1.246626 1.250985 1.264189 1.244678 1.245913
2012 Nov 06
1
[LLVMdev] nm-archive test failing on Windows
Hi, The Object/nm-archive test is failing for me on 64-bit Windows. It started recently, possibly with r166767. The output is as follows: 12> ******************** TEST 'LLVM :: Object/nm-archive.test' FAILED ******************** 12> Script: 12> -- 12> C:/dev/llvm/build/bin/Debug/llvm-nm.EXE c:\dev\llvm\test\Object/Inputs/archive-test.a-coff-i386 |
2009 Sep 22
2
chage the output file name
After I run my script I save all my output e.g. write.table(d, file = "C:/PINEheight.txt) write.table(v, file = "C:/PINEvolume.txt) write.table(v, file = "C:/PINEdiameter.txt) write.table(v, file = "C:/PINEdensity.txt) and then I would like to run again with another tree and save again e.g write.table(d, file = "C:/POPULUSheight.txt) Is there anyhow I can define a
2009 Jul 21
2
Split plot analysis problems
Hello, I would be very grateful if someone could give me a hand with my split plot design problems. So here is my design : I am studying the crossed-effects of water (wet/dry) and mowing (mowed/not-mowed = nm) on plant height (PH) within 2 types of plant communities (Xerobromion and Mesobromion) : - Within each type of communities, I have localised 4 blocks - In each block, I have defined
2005 Oct 03
1
storage.mode, C data types and speed
Hi, I am trying to speed up part of an algorithm in which certain columns of a large matrix (X) are replaced by the element-wise product of a matrix (M) and a vector (v). In R, the code might be X[, ind] <- M * v I have written a small C routine to do this for me, but the timing depends on how I define the storage.mode of the objects in R and the data types in C, in a way which I don't
2002 Aug 09
2
Help with improving efficiency
Dear All, I have a problem that I think could be solved much more efficiently, but I don't have a clue how to accomplish this. I have a matrix W with dimensions k*(p+1): Let's say W is 5*4 and looks like this: > W [,1] [,2] [,3] [,4] [1,] 1 -1 -1 1 [2,] 1 1 1 1 [3,] 1 2 -2 -1 [4,] 1 0 -1 -1 [5,] 1 -2 -1 0 I want to take
2009 Aug 18
0
[LLVMdev] Build issues on Solaris
Good day Nathan, If your using the stock GCC with Solaris, I am sorry to inform you its broken, Please see: http://llvm.org/docs/GettingStarted.html#brokengcc Please be warned as your get miss compiles and things will do strange `stuff`. As can be seen here, the reverse is true for both the GNU binutils and XPG4 versions of `nm' : -bash-3.2$ /usr/xpg4/bin/nm -p -u `find . -name
2007 Sep 12
2
[LLVMdev] Building uclibc ...
On 9/12/07, Chris Lattner <sabre at nondot.org> wrote: > > On Wed, 12 Sep 2007, Dound wrote: > > I am trying compile a libc with llvm (currently uclibc). I am able to > > compile uclibc by changing the Rules.mak to use llvm-gcc, llvm-ar, > llvm-ad, > > and not using strip. (I also use the --emit-llvm flag for > llvm-gcc). When > > I run llvm-nm on
2011 Mar 29
1
Typo in tools:::format.check_Rd_metadata()
Hi, With R version 2.13.0 alpha (2011-03-24 r55004), 'R CMD check' will produce the following output on some packages: * checking Rd metadata ... WARNING Error in is.function(FUN) : 'FUN' is missing Calls: print ... format.check_Rd_metadata -> unlist -> lapply -> match.fun Execution halted This is happening on packages that contain duplicated \name or
2007 Sep 13
0
[LLVMdev] Building uclibc ...
On Sep 12, 2007, at 3:56 PM, Dound wrote: > > > On 9/12/07, Chris Lattner <sabre at nondot.org > wrote: > On Wed, 12 Sep 2007, Dound wrote: > > I am trying compile a libc with llvm (currently uclibc). I am > able to > > compile uclibc by changing the Rules.mak to use llvm-gcc, llvm- > ar, llvm-ad, > > and not using strip. (I also use the --emit-llvm
2011 Jan 22
1
faster mvrnorm alternative
Hello, does anybody know another faster function for random multivariate normal variable simulation? I'm using mvrnorm, but as profiling shows, my algorithm spends approximately 50 % in executing mvrnorm function. Maybe some of you knows much faster function for multivariate normal simulation? I would be very gratefull for advices. -- View this message in context:
2006 May 17
1
Fix for augPred/gsummary problem (nlme library)
Dear R-users, I am a newbie to this site and a relative new-comer to S/R, so please tread lightly, for you tread... There have been several posting relating to problems with augPred() from the nlme library. Here is a "fix" for one of these problems which may lie at the root of others. In my case the problem with augPred() lay in gsummary(), which augPred() uses, causing it to fail.
1999 Jun 15
1
Accessing a function's environment
In a short course he is teaching here, Bill Venables has shown how to cache the results of a recursive calculation so that later invocations of the functions are speeded up. His example is an ingenious way of calculating all the subsets of size r from a set of size n. His version of this function for R stored these cached values in the global environment. I suggested that it might be preferable
2011 Aug 09
2
[LLVMdev] llvm-gcc with static libraries
Hello, While linking programs against static libraries built using llvm-ar and llvm-ranlib, I see an error message: could not read symbols: Archive has no index; run ranlib to add one collect2: ld returned 1 exit status Using either /usr/bin/nm or llvm-nm (depending on the use of --emit-llvm flag to llvm-gcc), one of them is able to list the symbols in the archive file. However, the link step