search for: makefram

Displaying 3 results from an estimated 3 matches for "makefram".

Did you mean: makefrag
2011 Dec 08
0
Fit initial time with modFit and modCost
...s example it's of course trivial, it suffices to find the first non-zero entry, but it become more challenging when e.g. the data is noisy). However, it seems that modFit can not do this, at least not in a straight forward manner. Here is my minimal example: ########### library(FME) #function makeframe creates a vector with 10 entries, the first t0 entries are 0, the remaining entries are h. Output is a #data.frame with "time" (1,2,...,10) and "M" (0,...,0,h,...,h) makeframe <- function(Par){ with(as.list(c(Par)),{ t <- seq(1,10,by=1) vec <- h*as.numeric(t>t0) ret...
2010 Mar 16
1
nested looping functions and dataframes
Hey All, So, I am confused how exactly to use nesting loop functions in R to spit out data frames. I've managed to create a working function for my data set that generates a data frame for a given set of Year i and Location j; but how would I do it for all Years and Locations? Here is my working function: test<-function(i,j){ a<-x[which(x$Year==i & x$Location==j),]
2007 Apr 05
2
creating a data frame from a list
Dear all, A few months ago, I asked for your help on the following problem: I have a list with three (named) numeric vectors: > lst = list(a=c(A=1,B=8) , b=c(A=2,B=3,C=0), c=c(B=2,D=0) ) > lst $a A B 1 8 $b A B C 2 3 0 $c B D 2 0 Now, I'd love to use this list to create the following data frame: > dtf = data.frame(a=c(A=1,B=8,C=NA,D=NA), +