similar to: for loop vectorization

Displaying 20 results from an estimated 100 matches similar to: "for loop vectorization"

2003 Sep 11
2
FAST_IPSEC doesn't seem to honor net.key.prefered_oldsa=0
When using the FAST_IPSEC option in the kernel build, the sysctl variable net.key.prefered_oldsa seems to make no difference. The kernel always chooses an old SA. This problem can be easily reproduced. Just wait till the soft limit of the SA is expired and do a setkey -F on the remote and then ping through the tunnel. Because the old SA's are preferred and the remote no longer has the old
2007 Aug 31
3
data frame row manipulation
Hello, struggling with the very basic needs... :( any help appreciated. #using the package doBY #who drinks how much beer per day and therefor cannot calculate rowise maxvals evaluation=data.frame(date=c(1,2,3,4,5,6,7,8,9), name=c("Michael","Steve","Bob", "Michael","Steve","Bob","Michael","Steve","Bob"),
2007 Jan 21
2
efficient code. how to reduce running time?
Hi, I am new to R. and even though I've made my code to run and do what it needs to . It is taking forever and I can't use it like this. I was wondering if you could help me find ways to fix the code to run faster. Here are my codes.. the data set is a bunch of 0s and 1s in a data.frame. What I am doing is this. I pick a column and make up a new column Y with values associated with that
2002 Jan 16
2
Subsetting data frames without a loop
I KNOW this should be easy, but I'm stuck. My data frame consists of multiple observations from each of a number of stations, and what I would like to do is create another data frame that contains all the variables of the first, but only rows where a certain variable is at its maximum for the station. So, for example: > my.df stn obs v 1 1 1 0.26400396 2 2 1
2012 Jan 10
1
error in Recursive
Hi I need help in the recursive problem. this is my code #Generate two random Numbers minval=20 maxval=100 cutoffValue=50 optVal<- function(cutoffValue,minval,maxval) { x=runif(2) x=x*cutoffValue for( i in 1:2) { if(x[i] < 30 || x[i] >60) # checking it falls between the range { optVal(cutoffValue,minval,maxval) } } return(x) }
2010 Mar 06
2
memory error in for loop
hi, I have been attempting to run this script and am getting some strange results. The script connects to a database and retrieves a series of tables, using sequential sql statements. I have tested all of the sql statements in the PostGreSQL terminal and they all return the desired results. I place each table into a list and run a FOR loop for 'i' in the list. The script generates
2007 Apr 14
0
Discontinuous stream support in libogg1
Hello, I recently added discontinuous stream support to libogg1. The patch is attached. I also wrote Writ codec for libogg1 (based on original code by Arc), and sample Writ encoder (SubRip to Writ converter) and decoder. Is anybody interested? WBR, Roman. -------------- next part -------------- Index: include/ogg/ogg.h =================================================================== ---
2007 Sep 04
4
Q: selecting a name when it is known as a string
I am 100% certain that there is an easy way to do this, but after experimenting off and on for a couple of days, and searching everywhere I could think of, I haven't been able to find the trick. I have this piece of code: ... attach(d) if (ORDINATE == 'ds') { lo <- loess(percent ~ ncms * ds, d, control=loess.control(trace.hat = 'approximate')) grid <-
2009 Sep 03
0
[LLVMdev] 2.6 pre-release1 ready for testing
On Thu, Sep 3, 2009 at 6:24 AM, Olivier Meurant<meurant.olivier at gmail.com> wrote: > Hi Tanya, > > I have tried the 2.6 pre-release on the following host : > > Windows XP pro SP2 with mingw/msys : > > uname -a > MINGW32_NT-5.1 OLIVE 1.0.10(0.46/3/2) 2004-03-15 07:17 i686 unknown > > gcc -v > Reading specs from d:/mingw/bin/../lib/gcc/mingw32/3.4.5/specs
2009 Sep 03
2
[LLVMdev] 2.6 pre-release1 ready for testing
Hi Tanya, I have tried the 2.6 pre-release on the following host : Windows XP pro SP2 with mingw/msys : uname -a MINGW32_NT-5.1 OLIVE 1.0.10(0.46/3/2) 2004-03-15 07:17 i686 unknown gcc -v Reading specs from d:/mingw/bin/../lib/gcc/mingw32/3.4.5/specs Configured with: ../gcc-3.4.5/configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads
2005 Sep 21
2
Help on optim
Dear R-help, I am new to optim function and need some help with optimization. Problem description: I am trying to optimize a weights vector such that it produce maximum value for a function maxVal. The optimization is subjected to constraint. The constraints are a) Min weight should be greater than or equal to Zero. b) Max weight should be less than or equal to 1 c) Sum of the
2005 Jul 05
0
lowess output looks wrong (PR#7891)
Just noticed nobody has commented on this, so I took a look, and I can't see the problem (2.1.0 looks the same as 2.1.1 to me). What is supposed to be wrong? Duncan Murdoch On 5/23/2005 2:35 PM, pelzc at ohsu.edu wrote: > Full_Name: Carl Pelz > Version: 2.1.0 & 2.0.1 > OS: Windows 2000 > Submission from: (NULL) (137.53.64.158) > > > # Paste this all into an R
2016 Apr 22
0
Finding Highest value in groups
Assuming your dataframe is in a variable x: > require(dplyr) > x %>% group_by(ID) %>% summarise(maxVal = max(Value,na.rm=TRUE)) On Fri, 2016-04-22 at 13:51 +0000, Saba Sehrish via R-help wrote: > Hi > > > I have two columns in data frame. First column is based on "ID" assigned to each group of my data (similar ID depicts one group). From second column, I
2006 Aug 29
1
writeChar
I have recently been using writeChar and writeBin to write binary files. These functions makes it very easy to write OS-independent files, which I am very happy with. I have however found a few issues, best illustrated by a short example > con <- file("test", open = "wb") > writeChar(as.character(c("ab", "ab")), nchars = c(3), con = con,
2007 Dec 03
2
interaction with C++ code (PR#10487)
Full_Name: Ian Wilson Version: 2.6.1 OS: linux Submission from: (NULL) (128.240.229.7) The problem is new to R2.6.?. The code works as expected in R-2.5.0. I get the problem with two different operating systems - an older redhat and new ubuntu and with both g++4.1 and g++3.4. I have a problem with character data that is passed back from C++ code. A small example is the following C++ code
2003 Nov 14
2
writeChar potential buffer overrun (PR#5090)
Trying to copy the (binary) header of a input file directly to an output file, I've had repeatable seg faults. The call: writeChar(hdr, outfh, nchars=6144) when hdr just contains one empty string seems to be the culprit. The stack traces weren't all that illuminating, with sig 11 in memory-related functions following this. But in src/main/connections.c it looks like do_writechar
2007 Jun 14
1
Clarification for readChar man page
Hi, Here's a patch to the readChar manual page (R-trunk as of today) that better clarifies readChar's return value. It could use some work as I'd also like to add some text about using nchar() to find the length of the string that readchar() returns, but I'm unsure which of type="bytes" or type="chars" to mention. Is it type="chars"? Index:
2008 Oct 06
3
horizontal boxplot + xlim
Hi there, I get a strange behaviour of a boxplot with the following code. There seems to be a problem with the xlim-parameter. Did I do anything wrong? What else can I do to force the boxplot to have a defined x-range? x <- rnorm(100) boxplot(x, notch=TRUE, xlab=parameter, xlim <- c(-4,4), horizontal = TRUE) Antje
2007 Mar 23
1
objects of class "matrix" and mode "list"?
Hello everyone, I cannot seem to find information about objects of class "matrix" and mode "list", and how to handle them (apart from flattening the list). I get this type of object from using sapply(). Sorry for the long example, but the code below illustrates how I get this type of object. Is anyone aware of documentation regarding this object? Thanks very much, Stephen
2001 Jun 23
3
gcc 2.95.2/irix/Laguerre_With_Deflation/inifinte loop
I built ogg vorbis from the rc1 cvs source on Irix 6.5.12 with gcc 2.95.2. Using oggenc I encoded about 8,000 aiff files but found about a dozen where oggenc would go into an infinite loop. I tracked the problem with Laguerre_With_Deflation() as far back as logmask being Inf in floor0_forward. I'm now building gcc 3.0 with the expectation this is a compiler issue. If not, I'll back