search for: numrow

Displaying 20 results from an estimated 26 matches for "numrow".

Did you mean: sumrow
2005 Apr 29
1
na.action
...;- testp[[3]][,] < 0.05 mat3 <- mat1 + mat2 The resulting mat3 (smaller version) matrix looks like: NA 0 0 0 0 NA 0 NA 0 0 NA 2 0 0 2 NA To get to the number of times a '2' appears in the rows, I was trying to run the following code: numrow = nrow(mat3) counter <- matrix(nrow = numrow,ncol =1) for(i in 1:numrow){ count = 0; for(j in 1:numrow){ if(mat3[i,j] == 2){ count = count + 1 } } counter[i,1] = count } However, I get the following error: 'Error in if (mat3[i, j] == 2) { : missing v...
2011 Aug 03
2
Error message for MCC
...vl) > colB <- vector(mode="numeric", length = vl) > tt <- vector(mode="numeric", length = vl) > > > ######################## > ## Calculate P-values ## > for (i in 1:3){ + temp1 <- read.table(files_to_test[i], header=TRUE, sep=" ") + numrows <- nrow(temp1) + tt_pvalue <- matrix(data=temp, nrow=numrows, ncol=vl) + colA <- temp[,compareA] + colB <- temp[,compareB] + tt <- t.test(colA, colB, var.equal=TRUE) + tt_pvalue <- tt$p.value + } Error in temp[, compareA] : incorrect number of dimensions -- Mat...
2014 Mar 31
1
C API to get numrow of data frame
Hi , Is there any C API to the R API nrow of dataframe ? x<- data.frame() n<- nrow(x) print(n) 0 Example : My C function which deals with data frame looks like and I don't to send the number of rows of data frame .I want to detect it from the function itself, my function take data frame as argument and do some on it. I want API equivalent to nrow. I tried Rf_nrows,Rf_ncols . No
2004 Apr 27
2
Gcc 3.4.0 and syslinux-2.09 menu
...3.4.0 because gcc complains that "ebp" cannot be used as a constraint. If preserving ebp is necessary 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...
2009 Jun 07
17
ActiveRecord Classes
...Scraper < ActiveRecord::Base # METHOD that define which URL to parse # METHOD that parses the data into an instanced variable called @rows # METHOD that should be updating my database table called "rushing_offenses" # Update Rushing Offense def update_rushing_offense for i in 0..@numrows-1 update_all(:name => @rows[i][0], :games => @rows[i][1]) puts "Updating Team Name = #{@rows[i][0]}." end end end The scraper.rake file contains: desc "This task will parse data from ncaa.org and upload the data to our db" task :scraper => :environm...
2009 Jun 06
5
Rake Tasks
...http://www.iterasi.net/openviewer.aspx?sqrlitid=wd5wiad-hkgk93aw8zidbw_ # require ''hpricot'' require ''open-uri'' # This class is used to parse and collect data out of an html element class Scraper attr_accessor :url, :element_type, :clsname, :childsearch, :doc, :numrows # Define what the url is, what element type and class name we want to parse and open the url. def initialize(url, element_type, clsname, childsearch) @url = url @element_type = element_type @clsname = clsname @childsearch = childsearch @doc = Hpricot(open(url)) @numrow...
2006 Oct 04
1
A more efficient code using whole object approach?
...the matrix and takes the resultant mean of the vector. 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]]
2002 Jun 21
1
naming things in functions
...L = PercentsMat( sepclusters[[k]], 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 sepc...
2010 Oct 01
1
[Help]:How to use "loop" to achieve this aim?
...automatic and fast? When compute each sample, the script type in R almost the same, just the input and output file's name is changed(chr1 change to chr2, chr3,chr4...). The first sample's script like this: >chr1=MEDIPS.readAlignedSeqences(BSgenome="hg19", file="chr1",numrows= ) >chr1=MEDIPS.genomeVector(data=chr1, bin_size=50,extend=250) ... ... >write.table(frameschr1.frame500.step250, file="frames.chr1.meth.txt", sep="\T", quote=F, col.names=T, row.names=F) The second sample's script like this: >chr2=MEDIPS.readAlignedSeqences(BSgen...
2004 Nov 22
0
IFELSE across a 3D array?
...e have got so 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.
2006 Mar 29
1
calcualtign a trailing 12 column mean in a dataframe?
I have a dataframe of 25 columns and 100,000 rows called ?testdf?. I wish to build a new dataframe, with 14 columns and 100,000 rows. I wish the new dataframe to have the ?trailing 12 column? mean. That is, I want column 1 of the new dataframe to have soemthing like: ?( mean(testdf[,1:12],na.rm=T)? What is the best way to accomplish this?
2009 Apr 15
2
The maximum number of rows in a com32 menu
Hey Murali, While playing with HDT which uses your menu, I found I can't reach more than 24 rows whereas my screen is 25. set_windows_size() relies on getnumrows() to define the maximum number of possible rows. But regarding to getnumrows() code, it sounds to report "// Actually numrows - 1". On my screen which is 80x25, getnumcols x getrowcols reports 80x24. The set_windows_size() is so refusing to set the screen up to 80x25. Is it a desired...
2007 Dec 26
1
data.frame - how to calculate the number of rows
...he 4th column, like: A B C num rows 1 3 6 6.16 3 (B is mean, C is variance by using summaryBy(B+C~ A, data=daten, FUN=c(mean,var)) from the doBy-package) But, how can I add the column 'numrow' and count the number of the rows? Thanks! Macki
2011 May 06
1
convert count data to binary data
Is there a way to generate a new dataframe that produces x lines based on the contents of a column? for example: I would like to generate a new dataframe with 70 lines of data[1, 1:3], 67 lines of data[2, 1:3], 75lines of data[3,1:3] and so on up to numrow = sum(count). > data pop fam yesorno count 1 126 1 70 1 127 1 67 1 128 1 75 1 126 0 20 1 127 0 23 1 128 0 15 Thanks, Chris Department of Biological Science Florida State University 319 Stadium Drive Tallahassee, FL 32306-42...
2009 Jun 02
2
bigmemory - extracting submatrix from big.matrix object
...filebacked big matrix 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...
2017 Aug 10
2
Problem with the fdim package
...I downloaded the the 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 v...
2017 Aug 11
0
Problem with the fdim package
...: Problem with the fdim 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...
2004 Nov 16
0
From S-Plus to R
...rixes as long 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...
2010 Jul 15
0
impute2mach GenABEL conversion problem
..., using column 2 of 'chr22_1000G.gen' --transpose = ON --Rmatrix = OFF --nanString = NA Number of lines in source file is 120030 Number of words in source file is 11207 skiprows = 0 cnrow = 0 skipcols = 5 rncol = 2 Rmatrix = 0 numWords = 11207 Creating file with numRows = 120030 Creating file with numColumns = 11202 text2fvf finished. Data file size (13928) differs from the expected (1083336944) [120030,11202] Error in checkSlotAssignment(object, name, value) : assignment of an object of class "NULL" is not valid for slot "data" in an obje...
2004 Oct 23
0
Re: FXTable -- numColumns & resize
...y rows will be filled in)? For that situation I think I''d recommend the FXTable#insertRows method (which is not destructuve like setTableSize is). To append a row to the end of the table, pass the current number of rows as the "starting" row number: aTable.insertRows(aTable.numRows, 1) > P.S. Should questions like this be sent to the list (fxruby-users), do > you want them sent to you, or do you not care one way or the other? I''d recommend sending them to the list, if only for the reason that someone else might answer your question(s) before I can get to the...