search for: nextelem

Displaying 4 results from an estimated 4 matches for "nextelem".

2009 Aug 07
2
create separate plots by factors
Hello, I am attempting to create several plots based on "site" (~300 total) and am having trouble with the code. I simply want to create a plot using the code, plot(year, peak), for the following dataset. I would like for each site to be plotted on a separate page and the plots saved in a directory. Would a "foreach" loop work? I tried a "by" statement, but
2010 Nov 16
2
Debugging segfault in foreach
...at.data.frame(x, digits = digits, na.encode = FALSE)) 4: print.data.frame(r) 5: print(r) 6: doTryCatch(return(expr), name, parentenv, handler) 7: tryCatchOne(expr, names, parentenv, handlers[[1L]]) 8: tryCatchList(expr, classes, parentenv, handlers) 9: tryCatch({ repeat { args <- nextElem(it) if (obj$verbose) { cat(sprintf("evaluation # %d:\n", i)) print(args) } for (a in names(args)) assign(a\ , args[[a]], pos = envir, inherits = FALSE) r <- tryCatch(eval(expr, envir = envir), error = function(e) e) if (obj...
2013 Jul 23
0
Function apply
...as.data.frame(X),((seq_len(nrow(X))-1)%/%10)+1),function(x) apply(x,2,mean))) #or ?res2<-t(sapply(split(as.data.frame(X),((seq_len(nrow(X))-1)%/%10)+1),colMeans)) ?identical(res1,res2) #[1] TRUE #orlibrary(itertools) it<-ihasNext(isplitRows(X,chunkSize=10)) ?while(hasNext(it)){ ?print( apply(nextElem(it),2,mean)) ?} #[1] 23.4 29.1 31.5 #[1] 28.2 21.8 17.2 #[1] 14.3 24.3 36.4 #[1] 22.2 25.2 24.2 #[1] 28.5 22.6 27.3 #[1] 19.6 25.6 20.0 #[1] 25.7 16.3 27.9 #[1] 20.0 24.8 26.7 #[1] 26.3 30.0 33.0 #[1] 21.9 24.0 32.3 #[1] 25.6 27.2 34.4 #[1] 13.7 30.2 16.7 #[1] 23.2 27.0 25.3 #[1] 26.4 28.6 25.2 ?h...
2013 Nov 15
1
Inconsistent results between caret+kernlab versions
I'm using caret to assess classifier performance (and it's great!). However, I've found that my results differ between R2.* and R3.* - reported accuracies are reduced dramatically. I suspect that a code change to kernlab ksvm may be responsible (see version 5.16-24 here: http://cran.r-project.org/web/packages/caret/news.html). I get very different results between caret_5.15-61 +