search for: combn2

Displaying 5 results from an estimated 5 matches for "combn2".

Did you mean: combn
2017 Jun 15
1
(no subject)
...", node = node, fitted = fitted, data = data, n = as.integer(n), from = from, prob = prob, debug = debug) 2: map.prediction(node = node, fitted = object, data = data, n = extra.args$n, from = extra.args$from, prob = prob, debug = debug) 3: predict.bn.fit(values10$fitted, input$targetvariables, combn2, prob = TRUE, method = "bayes-lw") 4: predict(values10$fitted, input$targetvariables, combn2, prob = TRUE, method = "bayes-lw") 5: t(attr(predict(values10$fitted, input$targetvariables, combn2, prob = TRUE, method = "bayes-lw"), "prob")) 6: observeEventHandle...
2001 Feb 20
0
dyn.load() and dyn.unload() under Windows
...tool --export-all-symbols --output-def weaklink.def weaklink.o gcc --shared -o ..\libs\weaklink.dll weaklink.def weaklink.o -LD:/Rw1021/src/gnuwin32 -lR The file weaklink.def made by mingw32 looks like this: ; dlltool --export-all-symbols --output-def weaklink.def weaklink.o EXPORTS sann @ 1 ; combn2 @ 2 ; In the file D:\Rw1021\library\weaklink\R\weaklink, I have this function: .First.lib <- function(lib, pkg) { library.dynam("weaklink", pkg, lib) require(MASS) } In weaklink.c, there are two functions declared, as __declspec (dllexport) SEXP sann(SEXP input); __declspec (dll...
2005 Dec 15
1
millions of comparisons, speed wanted
...tart ncolumns <- 6 input <- bincombinations(ncolumns) # from package e1071 # subset, let's say 97% of rows input <- input[sample(2^ncolumns, round(2^ncolumns*0.97, 0), ] minimized <- 1 while (sum(minimized) > 0) { minimized <- logical(nrow(input)) to.be.compared <- combn2(1:nrow(input)) # from package combinat # the following line takes _a lot_ of time, for millions of comparisons logical.result <- apply(to.be.compared, 1, function(idx) input[idx[1], ] == input[idx[2], ]) compare.minimized <- which(colSums(!logical.result) == 1) logical.resu...
2008 Jan 25
1
increasing speed for permutations of glm
...1:3),500,replace=TRUE),nrow=100,ncol=5) # the response is binary response <- c(rep(1,50),rep(0,50)) # initalize permutation of response 'labels'. perm.response <- response counts <- rep(1,18) # Number of permutations nperm <- 5 # matrix of all pairs of indices all.pairs <- combn2(1:ncol(myData)) # initalize results pmatrix <- matrix(-1,nrow=nperm,ncol=nrow(all.pairs)) getLRTpval <- function(index) { # A contingency table is formed from two columns of the data and the response (3 way table) and made into a vector counts <- as.vector(table(myData[,index[1]],myD...
2006 Jul 17
1
Getting rid of for loops
Hello R-users! I have a style question. I know that for loops are somewhat frowned upon in R, and I was trying to figure out a nice way to do something without using loops, but figured that i could get it done quickly using them. I am now looking to see what kind of tricks I can use to make this code a bit more aesthetically appealing to other R users (and learn something about R along the