search for: irow

Displaying 17 results from an estimated 17 matches for "irow".

Did you mean: iron
2017 Jul 05
4
expand gridded matrix to higher resolution
...e magic there, since it doesn't do what we need. replicate might be promising, but then still need to rearrange the output into the column and row format we need. A simple example: mm=matrix(1:15,nrow=3,byrow = T) xmm=matrix(NA,nrow=nrow(mm)*3,ncol=ncol(mm)*3) for(icol in 1:ncol(mm)) { for(irow in 1:nrow(mm)) { xicol=(icol-1)*3 +c(1:3) xirow=(irow-1)*3 +c(1:3) xmm[xirow,xicol]=mm[irow,icol] } } mm > > mm > [,1] [,2] [,3] [,4] [,5] > [1,] 1 2 3 4 5 > [2,] 6 7 8 9 10 > [3,] 11 12 13 14 15 > xmm > > xmm &gt...
2017 Jul 05
0
expand gridded matrix to higher resolution
...9;t do what we need. >replicate might be promising, but then still need to rearrange the >output into the column and row format we need. > >A simple example: >mm=matrix(1:15,nrow=3,byrow = T) >xmm=matrix(NA,nrow=nrow(mm)*3,ncol=ncol(mm)*3) >for(icol in 1:ncol(mm)) { > for(irow in 1:nrow(mm)) { > xicol=(icol-1)*3 +c(1:3) > xirow=(irow-1)*3 +c(1:3) > xmm[xirow,xicol]=mm[irow,icol] > } >} >mm >> > mm >> [,1] [,2] [,3] [,4] [,5] >> [1,] 1 2 3 4 5 >> [2,] 6 7 8 9 10 >> [3,] 11 1...
2008 Nov 25
1
Efficient passing through big data.frame and modifying select
...} > return(dframe) > } > > f2 <- > function(dframe){ > if(!is.data.frame(dframe)){ > stop("\"ResortCombinedFields\" input needs to be a data frame.") > } > for(icol in seq_len(ncol(dframe))){ > col <- dframe[,icol] > irow <- grep(";", col) > if (length(irow)) { > col[irow] <- unlist(lapply(strsplit(col[irow], ";"), > function(parts) paste(sort(parts), collapse=";"))) > dframe[,icol] <- col > } > } > return(dframe) > } > &...
2017 Jul 05
0
expand gridded matrix to higher resolution
...9;t do what we need. > replicate might be promising, but then still need to rearrange the output into the column and row format we need. > > A simple example: > mm=matrix(1:15,nrow=3,byrow = T) > xmm=matrix(NA,nrow=nrow(mm)*3,ncol=ncol(mm)*3) > for(icol in 1:ncol(mm)) { > for(irow in 1:nrow(mm)) { > xicol=(icol-1)*3 +c(1:3) > xirow=(irow-1)*3 +c(1:3) > xmm[xirow,xicol]=mm[irow,icol] > } > } > mm >> > mm >> [,1] [,2] [,3] [,4] [,5] >> [1,] 1 2 3 4 5 >> [2,] 6 7 8 9 10 >> [3,]...
2005 Apr 23
2
How to override coerion error in 'scan'
I am using 'read.csv' in V2.0.1 to read in a CSV file with the colClasses option and am getting an error from 'scan' when it encounters a non-numeric value for a 'numeric' column, i.e. > ds <- read.csv(in_file, nrows=irow, row.names=NULL, colClasses=zclass, comment.char="") Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec, : "scan" expected a real, got "03/15/200523:56:03" Is there a way to override this and just have it convert t...
2018 Feb 25
1
reshaping column items into rows per unique ID
...type <- unique(df1$DietType) nc <- length(custs) nd <- length(dtype) df2 <- as.data.frame( matrix(rep(0,nc*(nd+1)),nrow=nc), stringsAsFactors=FALSE) colnames(df2) <- c("CustId",dtype[order(dtype)]) df2$CustId <- custs[ order(custs) ] for ( i in 1:nrow(df1) ) { iRow <- match(df1$CustId[i],df2$CustId) iCol <- match(df1$DietType[i],colnames(df2)) df2[ iRow, iCol ] <- df2[ iRow, iCol] + 1 } > df2 # CustId a b c f j # 1 1 1 1 1 0 0 # 2 2 0 0 0 0 0 # 3 3 1 0 0 0 1 # 4 4 0...
2012 Feb 26
1
Matrix problem to extract animal associations
...NA FALSE FALSE FALSE TRUE ID7 FALSE FALSE FALSE FALSE FALSE FALSE NA FALSE FALSE FALSE ID8 FALSE FALSE FALSE FALSE FALSE FALSE FALSE NA FALSE FALSE ID9 FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE NA FALSE ID10 FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE NA > > irow <- as.character(gl(length(IDs),length(IDs),labels=IDs)) > icol <-rep(IDs, length(IDs)) > > AssocMatrix <- matrix(data=paste(irow,"_",icol,"_",sep=""), + nrow = length(IDs), ncol = length(IDs), + dimnames= li...
2018 Feb 25
0
reshaping column items into rows per unique ID
I believe you need to spend time with an R tutorial or two: a data frame (presumably the "table" data structure you describe) can *not* contain "blanks" -- all columns must be the same length, which means NA's are filled in as needed. Also, 8e^5 * 7e^4 = 5.6e^10, which almost certainly will not fit into any local version of R (maybe it would in some server version --
2005 Sep 26
3
How to get the rowindices without using which?
Hi, I was wondering if it is possible to get the rowindices without using the function "which" because I don't have a restriction criteria. Here's an example of what I mean: # take 10 randomly selected instances iris[sample(1:nrow(iris), 10),] # output Sepal.Length Sepal.Width Petal.Length Petal.Width Species 76 6.6 3.0 4.4 1.4
2018 Feb 25
4
reshaping column items into rows per unique ID
Hi All I have a datafram which looks like this : CustomerID DietType 1 a 1 c 1 b 2 f 2 a 3 j 4 c 4 c 4 f And I would like to reshape this so I can
2002 Jun 13
1
bad fisher.test() bug (PR#1662)
...e had to compile up gdb 5.2 to get the correct BDR> information out of R on Linux compiled under gcc-3.1. BDR> That shows (on the original problem) BDR> Loaded symbols for BDR> /users/ripley/R/R-patched/library/ctest/libs/ctest.so BDR> #0 f3xact (nrow=0x40051074, irow=0x4005113c, BDR> ncol=0x40051000, icol=0x40051120, dlp=0x4041b110, BDR> mm=0x40050fc0, fact=0x4035f020, ico=0x4035f4dc, BDR> iro=0x4035f5a4, it=0x4035f66c, lb=0x4035f734, BDR> nr=0x4035f7fc, nt=0x4035f8c4, nu=0x4035f98c, BDR> itc=0x4035fa54, ist=0x40360094, stv=0x...
2010 Oct 10
1
Create single vector after looping through multiple data frames with GREP
Hello all, I changed the subject line of the e-mail, because the question I''m posing now is different than the first one. I hope that this is proper etiquette. However, the original chain is included below. I've incorporated bits of both Ethan and Brian's code into the script below, but there's one aspect I can't get my head around. I'm totally new to programming
2010 Jul 27
1
R CMD build wiped my computer
...cs_house.c -o cs_house.o gcc -m64 -std=gnu99 -I/usr/include/R -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c cs_inv.c -o cs_inv.o cs_inv.c: In function ?cs_inv?: cs_inv.c:9: warning: ?irow? may be used uninitialized in this function cs_inv.c:9: warning: ?icol? may be used uninitialized in this function gcc -m64 -std=gnu99 -I/usr/include/R -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune...
2010 Jul 27
1
R CMD build wiped my computer
...cs_house.c -o cs_house.o gcc -m64 -std=gnu99 -I/usr/include/R -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c cs_inv.c -o cs_inv.o cs_inv.c: In function ?cs_inv?: cs_inv.c:9: warning: ?irow? may be used uninitialized in this function cs_inv.c:9: warning: ?icol? may be used uninitialized in this function gcc -m64 -std=gnu99 -I/usr/include/R -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune...
2010 Jul 27
1
R CMD build wiped my computer
...neric -c cs_house.c -o cs_house.o gcc -m64 -std=gnu99 -I/usr/include/R -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c cs_inv.c -o cs_inv.o cs_inv.c: In function ?cs_inv?: cs_inv.c:9: warning: ?irow? may be used uninitialized in this function cs_inv.c:9: warning: ?icol? may be used uninitialized in this function gcc -m64 -std=gnu99 -I/usr/include/R -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=gene...
2009 Mar 02
0
[PATCH 5 of 13] exploiting the new interface in vnc.c
...int *has_bg, int *has_fg) { - uint8_t *row = (ds_get_data(vs->ds) + y * ds_get_linesize(vs->ds) + x * vs->depth); + uint8_t *row = (ds_get_data(vs->ds) + y * ds_get_linesize(vs->ds) + x * ds_get_bytes_per_pixel(vs->ds)); pixel_t *irow = (pixel_t *)row; int j, i; pixel_t *last_bg = (pixel_t *)last_bg_; @@ -24,7 +24,7 @@ int bg_count = 0; int fg_count = 0; int flags = 0; - uint8_t data[(vs->pix_bpp + 2) * 16 * 16]; + uint8_t data[(vs->clientds.pf.bytes_per_pixel + 2) * 16 * 16]; int n_data...
2009 Mar 09
5
Help
....data.frame(dframe)){ > > >>> stop("\"ResortCombinedFields\" input needs to be a data frame.") > > >>> } > > >>> for(icol in seq_len(ncol(dframe))){ > > >>> col <- dframe[,icol] > > >>> irow <- grep(";", col) > > >>> if (length(irow)) { > > >>> col[irow] <- unlist(lapply(strsplit(col[irow], ";"), > > >>> function(parts) paste(sort(parts), collapse=";"))) > > >>> dframe[,i...