Displaying 2 results from an estimated 2 matches for "namefun".
Did you mean:
lamefun
2010 Aug 17
1
navel-gazing
...t;- "r-sig-mixed-models"
## month <- "2010q3"
n <- 50
baseurl <- "https://stat.ethz.ch/pipermail/"
library(RCurl)
z <- getURL(paste(baseurl,list,"/",month,"/author.html",sep=""))
zz <- strsplit(z,"<LI>")[[1]]
namefun <- function(x) {
gsub("\\n","",gsub("^.+<I>","",gsub("</I>.+$","",x)))
}
cnames <- sapply(zz[3:(length(zz)-1)],namefun)
rr <- rev(sort(table(cnames)))
library(lattice)
dotplot(~rev(rr[1:n]),xlab="Number of po...
2004 Apr 08
1
Why are Split and Tapply so slow with named vectors, why is a for loop faster than mapply
...t of time to complete. Here are the
results for just 5000 and 10000 records. You can see that there is a
scaling issue:
> testfun <- function(dataVector, nameVector, factorVector){
+ dataList <- split(dataVector, factorVector)
+ nameList <- split(nameVector, factorVector)
+ nameFun <- function(x, xNames){
+ names(x) <- xNames
+ x
+ }
+ mapply(nameFun, dataList, nameList, SIMPLIFY=TRUE)
+ }
> system.time(actTimeList <- testfun(actTime[1:5000], zoneNames[1:5000],
chainId[1:5000]))
[1] 2.99 0.00 2.98 NA NA
> system.time(actTimeL...