Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
R is a free, open source programming language and software environment for statistical computing and graphics.
4
votes
Optimization over 7 constants, running a function 10,000,000 times
You have several loops that are completely unnecessary. Remove them and you will see dramatic speedups. Take voltoalph and voltoenen for example:
voltoalph2 <- function(v,c) {
# v: a data vector
…
3
votes
Vectorize/speed-up exponentially weighted covariance calculation in R
While using sum() helps a lot (as josliber did), you can get another 2 orders of magnitude of performance improvement by removing two of the loops. You can replace them with a call to crossprod(). Us …
5
votes
Accepted
Permutations with repetitions algorithm in R
This is one of many instances where people would be tempted to say, "see, loops in R are slow". And my response is, "loops aren't that slow, but you can put slow code in loops." …