similar to: Nested lapply? Is this allowed?

Displaying 20 results from an estimated 3000 matches similar to: "Nested lapply? Is this allowed?"

2012 Mar 03
1
Sliding Window in R (solved)
Dear all, you can find below my solution for sliding a window. Please find below the code for the two alternatives and the benchmarks.     install.packages('caTools') require(caTools) do_sliding_for_a_window_duty_cycle <- function(DataToAnalyse,  windowSize) {   data<-DataToAnalyse   out <- numeric()   elements<- numeric()   if (length(data[,1]) >= windowSize){       for
2011 Nov 08
1
skip on error
Dear all, I have a different data sets and I am doing some calculations over time, For that every data set is split into junks based on the time stamps so one data set has like 10 timestamps. There is also the case that one data set has less than 10 timestamps. In my code I was doing the following lapply(Datasource,analysis_for_one_data_source)
2020 Oct 06
4
Solving a simple linear equation using uniroot give error object 'x' not found
Colleagues, I am trying to learn to use uniroot to solve a simple linear equation. I define the function, prove the function and a call to the function works. When I try to use uniroot to solve the equation I get an error message, Error in yfu n(x,10,20) : object 'x' not found. I hope someone can tell we how I can fix the problem
2004 Mar 16
3
rate of change
Hello I am wondering, how do I find if R has a certain funciton to do a given task. do I just type help.search("rate"). I am just trying to find a function to calculate the rate of change for a variable. I could come up with one if there isn't any allready builtin. thanks
2007 Oct 01
3
3-dimensional graph
Windows XP R 2.3.1 I have a funciton fit1<-lm(y~x+z) Is there a function that will produce a 3-dimensional plot of y,x,z? I looked at the help files, but did not find a clean answer to my question. Thanks, John John Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics University of Maryland School of Medicine Division of Gerontology Baltimore VA Medical Center 10 North Greene Street
2020 Oct 06
0
Solving a simple linear equation using uniroot give error object 'x' not found
On 06/10/2020 11:00 a.m., Sorkin, John wrote: > Colleagues, > I am trying to learn to use uniroot to solve a simple linear equation. I define the function, prove the function and a call to the function works. When I try to use uniroot to solve the equation I get an error message, > Error in yfu n(x,10,20) : object 'x' not found. > > I hope someone can tell we how I can fix
2004 May 24
2
Manova and specifying the model
Hi, I would like to conduct a MANOVA. I know that there 's the manova() funciton and the summary.manova() function to get the appropriate summary of test statistics. I just don't manage to specify my model in the manova() call. How to specify a model with multiple responses and one explanatory factor? If I type:
2010 Jan 08
4
Arguments of a function
Dear all, I have a question about how to set arguments in my own function. For example, I have a function that looks like this: my.f <- function(a = x1, b = x2) { x1 = equation 1 x2 = equation 2 x3 = equation 3 y = a + b } x1, x2, and x3 are temporary variables (intermediate results) calculated from other variables within the funciton. I want to use two of these three
2006 Jan 19
7
validates_numericality_of positive integer
Hi, What is the simplest way to validate a positive integer? validates_numericality_of :foo, :integer_only => true how do I add the positive part? Do I need another validation statement for pattern matching or do I have to write a validate() funciton for my model? Thanks, Peter
2000 Nov 30
3
Optimisation methods
I don't want to re-invent the wheel, and I'm trying to code up something that does a Nelder-Mead simplex method to minimise a non-linear objective function. (I'm porting something I originally wrote in matlab, using the optimisation toolbox funciton fmins). Is there already something available to do this included in R? Do people have suggestions on the best way to do this? Thanks,
2006 Dec 27
3
how to transform string to variable name in a fuction?
there is a data frame, like this: > df aa bb 1 a 20.27802 2 b 22.10664 3 c 21.33470 4 a 22.32898 5 b 19.73760 6 c 20.38979 .....(suppressed) what I want to do is to copy the data frame's rows into different data frames according to the levels of 'aa' column, > df.a <- df[df[,1]=='a',] ; df.b <- df[df[,1]=='b',] ; ....
2012 Dec 06
2
function to filter identical data.fames using less than (<) and greater than (>)
Esteemed UseRs, I've got many biggish data frames which need a lot subsetting, like in this example: # example eg <- data.frame(A = rnorm(10), B = rnorm(10), C = rnorm(10), D = rnorm(10)) egsub <- eg[eg$A < 0 & eg$B < 1 & eg$C > 0, ] egsub egsub2 <- eg[eg$A > 1 & eg$B > 0, ] egsub2 # To make this clearer than 1000s of lines of extractions with [] # I
2006 Jun 15
7
Executing a Function from AGI
Hmmm. Not having much luck with this. I'm trying to call the DUNDILOOKUP function and assign it to a variable in an AGI script. I've tried setting with EXEC CMD and with SET VARIABLE. In both cases, it's treating DUNDILOOKUP literally, rather than calling a funciton. I've tried this: EXEC "Set" "DIALPATH=${DUNDILOOKUP(2944093|180net)}" and also: SET VARIABLE
2002 Nov 04
2
Sweave - documenting a long function
Hi, I would like to use Sweave to document a long function. Is it possible to split the function's code into chunks such that Sweave will accept each chunk without complaining. I have tried various approaches without sucess but I feel sure that someone has done this already. Here is one attempt ============== % First, define the funciton header <<defFunHdr, eval=FALSE>>= x <-
2006 Sep 14
1
time varying covariates
Hello, I am trying to model an intensity function with time-varying covariates. Before, I have successfully defined a log likelihood function for a Power-Law Process (lambda(t)=alpha*beta*t^(beta-1)) with two paramters and no covariates for a repairable systems with failure times (t). This function was maximized with R optim. No problem! But now I want to include a covariate indicating a
2010 Aug 15
1
greatest common divisor
Hello, Is there a function in R with which we could find the greatest common divisor directly? Or is there a funciton, which could help us to find the remainder of a division directly? Best wishes! Thank you! Your truly, Qing -- View this message in context: http://r.789695.n4.nabble.com/greatest-common-divisor-tp2326262p2326262.html Sent from the R help mailing list archive at
2011 Dec 12
1
k-folds cross validation with conditional logistic
--begin inclusion -- I have a matched-case control dataset that I'm using conditional logistic regression (clogit in survival) to analyze. I'm trying to conduct k-folds cross validation on my top models but all of the packages I can find (CVbinary in DAAG, KVX) won't work with clogit models. Is there any easy way to do this in R? -end inclusion -- The clogit funciton is simply a
2011 Jan 21
1
[LLVMdev] About static-profile in llvm-2.8
When I searched for branch frequency profiling on the internet, I got this link by a casual chance: http://homepages.dcc.ufmg.br/~rimsa/tools/stprof-llvm.patch. It seems it was written by Andrei Rimsa. So I downloaded and integrate these files into the llvm-2.8 building. After the building, I tried "opt -static-profile bitcnt_1.bc", and an segment fault error occured. I debugged it
2012 Mar 28
1
[LLVMdev] Removing Intrinsic Functions
There are a few instrinsic functions I would like to remove, is this possible? For example, the llvm.lifetime and llvm.dbg instrinsics? You can't simply iterate over the funciton and remove the call instructions, this causes issues. Is there a known structured way of doing this? -------------- next part -------------- An HTML attachment was scrubbed... URL:
2019 Jun 22
1
last login user tracking
On 22/6/2019 16:07, John Fawcett via dovecot wrote: > > You can easily view the value in a readable format with the > FROM_UNIXTIME mysql funciton > > https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_from-unixtime > > To get remote ip > > define the rip field in your table and add it to the primary key > > add %r to the