similar to: list index rules evaluation behavior

Displaying 20 results from an estimated 290 matches similar to: "list index rules evaluation behavior"

2010 Jan 04
3
Extract vector elements until cumsum <= x
Hi All, I have a vector n, and for each n[i] I want to extract n[i], n[i+1], n[i+2]..., until the cumulative sum of n[i] and subsequent elements exceeds a CheckValue, whereupon I move to the next index and repeat. I am trying to find a Vectorized approach, and have seen similar posts where filter{stat} and rollmean{zoo} were suggested, but, I haven't been able to figure a way to use them
2010 Mar 08
1
lapply and list indexing basics
I have split my original dataframe to generate a list of dataframes each of which has 3 columns of factors and a 4th column of numeric data. I would like to use lapply to apply the fitdistr() function to only the 4th column (x$isi) of the dataframes in the list. Is there a way to do this or am I misusing lapply? As a second solution I tried splitting only the numeric data column to yield a list
2012 Mar 13
1
Writing a .pdf file within a function - what do I need to return()?
I am trying to write a function that generates one PDf containing plots from several .csv files within a directory. When I manually execute the code it seems to work, but not when it is a function. I think I need to return() something, but haven't had much luck figuring out what/how. plot.isi<-function(csv.path="~/project/csv by cell") { csv.files<-grep('.csv',
2010 Mar 08
1
lapply and list indexing basics (after realizing I wasn't previously subscribed...sorry)
I have split my original dataframe to generate a list of dataframes each of which has 3 columns of factors and a 4th column of numeric data. I would like to use lapply to apply the fitdistr() function to only the 4th column (x$isi) of the dataframes in the list. Is there a way to do this or am I misusing lapply? As a second solution I tried splitting only the numeric data column to yield a
2011 Dec 08
1
partial duplicates of dataframe rows, indexing and removal
Hello. I am trying to remove from my dataframe, those rows in which the first 7 columns are duplicated even if subsequent columns make those rows unique. df<-data.frame(id=rep(c('amy','bob','joe') , each=5), pet1=sample(LETTERS[1:3],15, replace=T), pet2=sample(LETTERS[1:3],15, replace=T), pet3=sample(LETTERS[1:5],15, replace=T)) >df id pet1 pet2
2010 Mar 26
1
a vectorized solution to some simple dataframe math?
I have a data frame containing the results of time measurements taken from several cells. Each cell was measured in conditions A and B, and there are an arbitrary number of measurements in each condition. I am trying to calculate the difference of each measurement from the mean of a given cell in a given condition without relying on loops. >my.df id cond time 1
2006 Dec 28
1
LU bug in Matrix package
There is a bug in Matrix package, please check it, thanks! Matlab result: x = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 >> lu(x) ans = 21.0000 22.0000 23.0000 24.0000 25.0000 0.0476 0.9524 1.9048 2.8571 3.8095 0.7619
2004 Jan 14
2
Generalized least squares using "gnls" function
Hi: I have data from an assay in the form of two vectors, one is response and the other is a predictor. When I attempt to fit a 5 parameter logistic model with "nls", I get converged parameter estimates. I also get the same answers with "gnls" without specifying the "weights" argument. However, when I attempt to use the "gnls" function and try to
2010 Apr 25
1
Manipulating text files
Dear R Community, I am trying to optimize a water quality model that I am using. Based on conversations with others more familiar with what I am doing I plan to implement DEOptim to do this. The water quality model is interfaced through a GUI. I have the input file necessary to alter parameters and run the model as a text file. To do the optimization I have figured out the general procedure
2004 Jun 10
2
odesolve: lsoda vs rk4
I'm trying to use odesolve for integrating various series of coupled 1st order differential equations (derived from a system of enzymatic catalysis and copied below, apologies for the excessively long set of parameters). The thing that confuses me is that, whilst I can run the function rk4: out <- rk4(y=y,times=times,func=func, parms=parms) and the results look not unreasonable:
2010 Sep 08
2
Correlation question
Hi everyone, I'm observing what I believe is weird behaviour when attempting to do something very simple. I want a correlation matrix, but my matrix seems to contain correlation values that are not found when executed on pairs: > test2$P2 [1] 2 2 4 4 1 3 2 4 3 3 2 3 4 1 2 2 4 3 4 1 2 3 2 1 3 > test2$HP_tot [1] 10 10 10 10 10 10 10 10 136 136 136 136 136 136 136 136 136
2010 May 23
4
creating a reverse geometric sequence
Hello, Can anyone think of a non-iterative way to generate a decreasing geometric sequence in R? For example, for a hypothetical function dg, I would like: > dg(20) [1] 20 10 5 2 1 where I am using integer division by 2 to get each subsequent value in the sequence. There is of course: dg <- function(x) { res <- integer() while(x >= 1) { res <- c(res, x) x
2011 May 22
2
Finding solution set of system of linear equations.
I have a simple system of linear equations to solve for X, aX=b: > a [,1] [,2] [,3] [,4] [1,] 1 2 1 1 [2,] 3 0 0 4 [3,] 1 -4 -2 -2 [4,] 0 0 0 0 > b [,1] [1,] 0 [2,] 2 [3,] 2 [4,] 0 (This is ex Ch1, 2.2 of Artin, Algebra). So, 3 eqs in 4 unknowns. One can easily use row-reductions to find a homogeneous solution(b=0) of: X_1
2007 Sep 21
1
Is it solve.QP or is it me?
Hi. Here are three successive examples of simple quadratic programming problems with the same structure. Each problem has 2*N variables, and should have a solution of the form (1/N,0,1/N,0,...,1/N,0). In these cases, N=4,5,6. As you will see, the N=4 and 6 cases give the expected solution, but the N=5 case breaks down. >cm8 [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1 0
2007 Feb 23
2
bug with boolean query evaluation containing parenthesis and NOT ?
Hi, The following [simplified] query works well, however a variation which includes parenthesis seems to fail, in that it returns hits which should be excluded by the NOT term. This is surprising because in this simple case, the parenthesis shouldn''t change the Boolean evaluation ... any pointers? Working Query: field1:value1 AND NOT field2:value2 Failing Query: field1:value1 AND
2006 Mar 31
0
Rails questions businesses ask during evaluation
OBJECTIVITY CRUTCH: Replace every occurance of "Rails 1.1" with "Zope 3.2" in this post before reading it. Personally, I enjoy having lots of cool new features in each release. But others (like my company) value improved reliability over new features and ask a bunch of questions during software evaluations. Examples: * Are there plans for bugfix-only releases of [Rails
2001 Aug 24
1
evaluation of ext3 for S/390 and zSeries
Hello, in the last weeks I evaluated ext3 on the IBM Mainframe S/390 and IBM zSeries. (32 bit, big endian, 64 bit big endian) Ext3 had to face high stress tests, low memory situations, spontaneous resets as well as hardware failure simulations. I tested file system integrity,log replay and stability with ordered and journal mode. All with 32 and 64 bit. I think ext3 has reached a very stable
2010 Aug 12
0
Error: evaluation nested too deeply
Hi guys, I have a code in R and it was work well but when I decrease the epsilon value (indicated in the code) , then I am getting this error Error: evaluation nested too deeply: infinite recursion / options(expressions=)? any help please y = 6.8; w = 7.4; z = 5.7; muy = 7; muw = 7; muz = 6; sigmay = 0.8; sigmaz = 0.76; sigmaw = 0.3; betayx = 0.03; betayz = 0.3; betayw = 0.67 s =
2001 Sep 04
1
evaluation is nested too deeply: infinite recursion?
I recently started using R (Version 1.3.0 on a Dell machine). After using R for about a week, I started receiving the error message shown below. I can't even run simple commands that I know should work. Is this a bug or did I just mess something up? I've uninstalled and reinstalled R but continue to receive the same errors. The errors are shown below: R : Copyright 2001, The R
2010 Feb 11
0
Recall function: "evaluation nested too deeply: infinite recursion / options(expressions=)?"
hello all i searched the archives and couldn't get a solution to the following question. i have the following function: F=function(z,v) { if (v==-.5) return(1) else return(2*v/z + 1/Recall(z,v-1)) } and while testing whether it works (ie F(z,v) is approx = besselK(z,1+v)/besselK(z,V). the recursion formula allows one to calculate besselK(z,1+v)/besselK(z,V) for large values of z )