search for: outlist

Displaying 10 results from an estimated 10 matches for "outlist".

Did you mean: outlast
2010 Aug 20
3
change object name within for loop
Hi, I am writing a for loop that creates one object, say 'outn' on every round of the loop. I would like the name of each object to include the index of the loop as in, for example: out1, out2, out3, ... And I would like the naming of the object to take place automatically as the loop moves through? Similarly, I would like to be able to call different objects (in1, in2, in3,
2012 Nov 29
0
Simper analysis with Morisita-Horn
...ght. function (comm, group, ...) { if (any(rowSums(comm, na.rm = TRUE) == 0)) warning("you have empty rows: results may be meaningless") permutations <- 0 trace <- FALSE comm <- as.matrix(comm) comp <- t(combn(unique(as.character(group)), 2)) outlist <- NULL P <- ncol(comm) nobs <- nrow(comm) if (length(permutations) == 1) { perm <- shuffleSet(nobs, permutations, ...) } else { perm <- permutations } if (ncol(perm) != nobs) stop(gettextf("'permutations' have %d colu...
2018 Oct 05
2
Seg fault stats::runmed
Dear all, I just found this issue: dd1 = c(rep(NaN,82), rep(-1, 144), rep(1, 74)) xx = runmed(dd1, 21) -> R crashes reproducibly in R 3.4.3, R3.4.4 (Ubuntu 14.04/Ubuntu 16.04) With GDB: Program received signal SIGSEGV, Segmentation fault. swap (l=53, r=86, window=window at entry=0xc59308, outlist=outlist at entry=0x12ea2e8, nrlist=nrlist at entry=0x114fdd8, print_level=print_level at entry=0) at Trunmed.c:64 64??? ??? outlist[nr/* = nrlist[l] */] = l; Valgrind also reports access to unallocated memory and/or writing past the end of the heap. The crash does not happen if the order is cha...
2007 Apr 11
5
how to reverse a list
Hi, there: I am wondering if there is a quick way to "reverse" a list like this: t0 <- list(a=1, b=1, c=2, d=1) reverst t0 to t1 > t1 $`1` [1] "a" "b" "d" $`2` [1] "c" thanks. -- Weiwei Shi, Ph.D Research Scientist GeneGO, Inc. "Did you always know?" "No, I did not. But I believed..." ---Matrix III
2011 Feb 17
1
cv.glmnet errors
...ultinomial regression using the glmnet package, but the following gives me an error (for no reason apparent to me): library(glmnet) cv.glmnet(x=matrix(c(1,2,3,4,5,6,1,2,3,4,5,6), nrow=6),y=as.factor(c(1,2,1,2,3,3)),family='multinomial',alpha=0.5, nfolds=2) The error i get is: Error in if (outlist$msg != "Unknown error") return(outlist) : argument is of length zero If i change the number of folds to 1, i get a seg fault: *** caught segfault *** address 0x0, cause 'memory not mapped' Traceback: 1: .Fortran("lognet", parm = alpha, nobs, nvars, nc, as.double(x...
2010 Jun 02
2
glmnet strange error message
...l factor. I can fit the model with no errors but when I try to cross-validate after about 30 seconds I get the following: > glmnet.fit = glmnet(covars,resp,family="multinomial") > glmnet.cv = cv.glmnet(covars,resp,family="multinomial",type="class") Error in if (outlist$msg != "Unknown error") return(outlist) : argument is of length zero It seems like it makes it through the first couple folds but trips up somewhere in the middle. The example in the documentation works perfectly on my machine. Any ideas on what the problem may be? Thanks! Dave -- V...
2018 Oct 05
0
Seg fault stats::runmed
...uch, Hilmar! I will have a look, to ensure missing values (incl NaN) are handled propertly. Martin -- Martin Maechler ETH Zurich and R Core Team > With GDB: > Program received signal SIGSEGV, Segmentation fault. > swap (l=53, r=86, window=window at entry=0xc59308, > outlist=outlist at entry=0x12ea2e8, nrlist=nrlist at entry=0x114fdd8, > print_level=print_level at entry=0) at Trunmed.c:64 > 64??? ??? outlist[nr/* = nrlist[l] */] = l; > Valgrind also reports access to unallocated memory and/or writing past > the end of the heap. >...
2011 Jan 17
1
how to cut a multidimensional array along a chosen dimension and store each piece into a list
...e each piece (still an array of one dimension less) into a list. For example, arr <- array(seq(1*2*3*4),dim=c(1,2,3,4)) # I made a point to set the length of the first dimension be 1to test whether I worry about drop=F option. brkArrIntoListAlong <- function(arr,alongWhichDim){ #### return(outlist) } I have tried splitter_a in plyr package but does not get what I want. library(plyr) plyr:::splitter_a(arr,3) I understand that I can write a for loop to make it happen but I am searching for a better solution. Thanks in advance. -Sean [[alternative HTML version deleted]]
2009 Nov 24
5
Split column
Hello, R users, I have a dataset that looks like this: id var1 var2 1 1 3 2 3 1 3 2 1 4 1 2 5 2 3 I want to split one column to two columns with 1 = 1 and 1, 2 = 1 and 2, 3 = 2 and 2: id var1.1 var1.2 var2.1 var2.2 1 1 1 2 2 2 2 2 1 1 3 1 2
2011 Dec 07
1
Output table from for loop
Hi, this might be basic but can't get it to work and it is hampering my R usage: #the loop is checking variance of rows, and cutting out rows with var>numVec[i] #I define outMat as object names I want to output to (does this make sense? how else #can I define sequential numbered output?) #numVec is numbers I use in the loop head(Counts) AN1 AN2 AN3 AN4 var GENE1