search for: numrows

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

2005 Apr 29
1
na.action
Hi, I had the following code: testp <- rcorr(t(datcm1),type = "pearson") mat1 <- testp[[1]][,] > 0.6 mat2 <- 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
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 -- Matt...
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 => :environme...
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)) @numrows...
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 sepcl...
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(BSgeno...
2004 Nov 22
0
IFELSE across a 3D array?
Dear all, We are trying to clean multiple realizations of a pattern. Erroneous NODATA and spurious DATA occur in the realizations. As we have to do a 1000 realizations for many patterns, efficiency of the code is important. We need to correct the realizations with a 'mask' pattern of DATA/NODATA. We think an ifelse should do the job. Spurious DATA will be simply removed using the
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
Hello, it seems to be a simple problem, but I couldn't find an answer in the archiv. (I think, it must has something to do with the group-select, like in php) I've the following data.frame: A B C 1 3 6 5 2 4 4 20 3 5 8 2 I want to get the number of the
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
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 i...
2017 Aug 10
2
Problem with the fdim package
Hi, I?m new to R but I?m interested in using the fdim package to find the fractal dimension of a dataset. 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",
2017 Aug 11
0
Problem with the fdim package
Hm, I am not an expert in this field but trying to use obviously old package which was removed about 5 years ago from CRAN is asking for problems. There is probably some incompatibility between recent R version and obsolete package. You either 1. need to install/compile R version from 2012 and install/compile this old package for this version. 2. Or you could try to find some similar
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 objec...
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 them...