search for: numcol

Displaying 16 results from an estimated 16 matches for "numcol".

Did you mean: sumcol
2010 Mar 30
1
Adding RcppFrame to RcppResultSet causes segmentation fault
...the same code in RcppExamples package to try adding RcppFrame object to RcppResultSet. When running it gives me segmentation fault problem. I'm using gcc 4.1.2 on redhat 64bit. I'm not sure if this is the cause of the problem. Any advice would be greatly appreciated. Thank you. Rob. int numCol=4; std::vector<std::string> colNames(numCol); colNames[0] = "alpha"; // column of strings colNames[1] = "beta"; // column of reals colNames[2] = "gamma"; // factor column colNames[3] = "delta"; // column of Dates RcppFrame frame(colNames); // T...
2004 Apr 27
2
Gcc 3.4.0 and syslinux-2.09 menu
...cessary then it will have to be done in the assembler code. Gcc 3.3.3 just seems to ignore the constraint. It didn't do anything special to preserve the register. I also noticed that getnumrows returns the contents of 0x484 which is the number of rows minus one but menu.c has this ms->numcols = getnumcols(); ms->numrows = getnumrows(); ms->maxcol = ms->numcols - 1; ms->maxrow = ms->numrows - 1; which makes maxrow = rows - 2. Is this intentional? BTW, if you put this line __asm__ (".code16gcc\n\t"); in an include file and include that file at th...
2010 Jul 13
2
Checking for duplicate rows in data frame efficiently
...ow=TRUE) > df <- data.frame(m) > df X1 X2 X3 X4 X5 1 1 1 1 1 1 2 2 2 2 2 2 3 6 6 6 6 6 4 3 3 3 3 3 5 4 4 4 4 4 6 5 5 5 5 5 7 1 1 1 1 1 8 1 1 1 1 1 9 2 2 2 2 2 10 7 7 7 7 7 > > compareTwoRows <- function(row1, row2){ + numCol <- 5 + logicalRow <- row1==row2 + duplicate <- sum(logicalRow)==numCol + return(as.numeric(duplicate))} > > same <- matrix(0, byrow=TRUE, ncol=10,nrow=10) > > for (j in 1:9) + for (k in (j+1):10) + same[j,k] <- compareTwoRows(df[j,],df[k,]) > > same...
2002 Jun 21
1
naming things in functions
..., pL, all ) } PercentsMat <- function(clusters, percentsmatrix, ltype){ . . . result = rbind( percentsmatrix, newpercents ) rnames = c(dimnames(percentsmatrix)[[1]], deparse(substitute(clusters))) numrows = length(rnames) numcols = dim(result)[2] } res = matrix(result, nrow = numrows, ncol = numcols, dimnames = list(rnames, NULL)) return(res) } Some actual output of SummaryMat: $pL [,1] [,2] [,3] sepclusters[[k]] 100 0 0 sepclusters[[k]] 0 0 100 sepclusters[[k]] 45 55 0 I w...
2006 Aug 28
1
Extracting column name in apply/lapply
Hi, any good trick to get the column names for title() aside from running lapply on the column indexes? Thanks Nick. apply(X[,numCols],2,function(x){ nunqs <- length(unique(x)) nnans <- sum(is.na(x)) info <- paste("uniques:",nunqs,"(",nunqs/n,")","NAs:",nnans,"(",nnans/n,")") hist(x,xlab=info) # --> title("???") }) --------------...
2004 Nov 22
0
IFELSE across a 3D array?
...far: ********************* library(abind) #Sim: 0=Absent; 1=Present; 10=NODATA vectSim <- c(0,1,0,1,10,0,1,0,1,1,10,0,1,1,0,1,0,10,10,1,0,1,0,1,0,1,1,10,0,10,10,1,0,1,0,10) #Mask: 1=DATA; 10=NODATA vectMask <- c(10,1,10,1,1,10,1,10,1,10,10,1) length(vectSim) length(vectMask) numRow<-3 numCol<-4 numReal<-3 Sim <- array(vectSim, c(numRow,numCol,numReal)) Sim Mask <- array(vectMask, c(numRow,numCol)) Mask SmoothSim <- apply(Sim, c(1,2), ifelse(MaskSim==10,33,99)) SmoothSim ******************** Any help is much appreciated! Thanks, Sander and Alessandro.
2004 Oct 23
0
Re: FXTable -- numColumns & resize
On Fri, 22 Oct 2004 13:39:06 -0700, Bob Sidebotham <bob@windsong.bc.ca> wrote: > In 1.2 FXTable, numColumns is documented as numCols, but should be > numColumns, I think. Also the examples/table.rb app uses numCols, and > should use numColumns. Yes, you''re right. I''ve added both of these bugs to the FXRuby bug list, found here: http://rubyforge.org/tracker/index.php?grou...
2008 Nov 25
1
Problem running R from within a script
...s() inFileArg <- scratchOne[10] taxFileArg <- scratchOne[11] sink("debugout.txt", FALSE, "output", FALSE) print (inFileArg) print (taxFileArg) bankData <- read.xport(inFileArg) sink(NULL) sink(taxFileArg, FALSE, "output", FALSE) bdNames <- names(bankData) numCol <- ncol(bankData) i=1 while (i <= numCol) { myVar <- paste(bdNames[i], typeof(bankData[[bdNames[i]]]), sep=":") print(myVar) i=i+1 } q() Thanks! -josh -- ----- http://www.globalherald.net/jb01 GlobalHerald.NET, the Smarter Social Network! (tm)
2009 Jun 02
2
bigmemory - extracting submatrix from big.matrix object
...atrix of my data and get the following warning: > x = read.big.matrix("/home/utkarsh.s/data.csv",header=T,type="double",shared=T,backingfile = "backup", backingpath = "/home/utkarsh.s") Warning message: In filebacked.big.matrix(nrow = numRows, ncol = numCols, type = type, : A descriptor file has not been specified. A descriptor named backup.desc will be created. However there is no such argument in "read.big.matrix". Although there is an argument "descriptorfile" in the function "as.big.matrix" but if I try to use...
2006 Oct 04
1
A more efficient code using whole object approach?
...ector. I know I should use the whole object approach somehow but after many tries I gaave up for the long approach. I know the explanation above is rather long and I apologize for that, any hint/help will be greatly appreciated. for (i in 1:numrows) { mo.o<-t(array(m.o.f[i,],dim=c(numcols,numrows))) t<-Dm*m.o^alpha1m l1[i]<-mean(apply(t,1,"prod")) } Best Regards, --------------------------------- [[alternative HTML version deleted]]
2007 Dec 06
0
alternatives to latex() or xtable()
...= function(df,num.by.vars=1,...) { # first num.by.vars groups must be sorted and in descending order of priority if(!is.numeric(num.by.vars) | length(num.by.vars)!=1) { stop("num.by.vars must be a number") } # Create a by.vars vector by.vars=1:num.by.vars numcols=length(colnames(df)) df.original=df # Initialize our clines variable (gives the start column of the cline for each row) clines = rep(num.by.vars+1,length(df[[1]])) # - Make grouping columns multirow - # for(b in rev(by.vars)) { # Create a groups variable for all by.va...
2017 Aug 10
2
Problem with the fdim package
...e package from https://cran.r-project.org/src/contrib/Archive/fdim/ and successfully installed it together with xgobi. However, when I try to run the first example, after df <- fdim(mydata,q=0,Alpha=0.3) I get the following error: Error in .C("pointdif", as.integer(NumRow), as.integer(NumCol), as.integer(X), : "pointdif" not available for .C() for package ?fdim" It looks like the pointdif C file is not found in the folder. I was wondering if you could know the solution to my problem. Thank you very much in advance. Ginevra [[alternative HTML version deleted]]
2009 Mar 02
2
R-code help for filtering with for loop
Dear Sir / Madam, I am new for R coding. Kindly help me out in sorting out the following problem. There are 50 rows with six coloumns(you could see in the attached .txt file). I wish to go for filtering this 50 rows for any one of the six coloumns satisfying the value >= 64. I need to have a final table with rows having >= 64 value in any one of the six coloumns and the rest could be
2017 Aug 11
0
Problem with the fdim package
...dim package > > Hi, > > The R version is R 3.4.0 GUI 1.70 El Capitan build (7338), while fdim is version > 1.0-7. I?ve tried to run the examples from the documents but I always get the > same error message: > > Error in .C("pointdif", as.integer(NumRow), as.integer(NumCol), as.integer(X), > "pointdif" not available for .C() for package ?fdim? > > pointdif is present in the fdim folder, but it seems R doesn?t find it. > > Thank you for your help. > > Cheers, > Ginevra > > > On 11 Aug 2017, at 08:13, PIKAL Petr <petr.pikal...
2004 Nov 16
0
From S-Plus to R
...as possible and not the its (S4) objects, since this makes some commands very slow (like union). There are also other packages like zoo, tsseries (I guess) and certainly Rmetrics, which should have all you need Most functions transform directely and easily. Among others, I missed the numRows() and numCols() etc in R, but this can be redone quickly. One big advantage of S-Plus is the possibility to edit graphics and to make Powerpoints presentations very quickly. Also the Excel interface is already build in. In R you must always programm to whole picture, which is ok if you are doing the same task...
2004 Jun 17
2
nlme graphics in a loop problem
Hi, I'm fitting mixed effects models using the lme function of the nlme package. This involves using the various associated plot functions. However, when I attempt to fit a number of models using an loop, whilst the models work, the plot functions fail. As a trivial example, the following works: library(nlme) graphics.off() x<-c(1:10) y<-c(1:4,7:12)