search for: arrayind

Displaying 19 results from an estimated 19 matches for "arrayind".

Did you mean: arrayid
2013 Apr 03
3
arrayInd and which
Folks, I have Googled but not found much regarding arrayInd aside from the "which" help page. Any good examples or docs on what arrayInd does that is better or different from which()? In addition take the following 20x10 matrix: td<-structure(c(1, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 1...
2024 Mar 20
1
Building Packages.
...???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? jhBase conflicts ?? ? `andNotNA` masks `jhBase::andNotNA()`. ? `array.named` masks `jhBase::array.named()`. ? `arrayInd.inv` masks `jhBase::arrayInd.inv()`. ? and more. ? Did you accidentally source a file rather than using `load_all()`? Run `rm(list = c("andNotNA", "array.named", "arrayInd.inv", "as.POSIXct_orig", "build.package", "colon", "fil...
2017 Aug 24
5
functions from 'base' package are not accessible
...somevar) : could not find function "length" So it looks like base package is not loaded. Still if type 'which' in console I get function (x, arr.ind = FALSE, useNames = TRUE) { wh <- .Internal(which(x)) if (arr.ind && !is.null(d <- dim(x))) arrayInd(wh, d, dimnames(x), useNames = useNames) else wh } <bytecode: 0x0000000006c6e258> <environment: namespace:base> base (that contains which function) package is installed. R version is 3.4.1 and system is Win8 Where should I look to understand how to fix the problem? Thank yo...
2012 Nov 15
3
how to view source code of a function inside a package?
...oblem displaying the hidden function. Say, for example the MCMC package. How do you view the code of that function? something like this: > which function (x, arr.ind = FALSE, useNames = TRUE) { wh <- .Internal(which(x)) if (arr.ind && !is.null(d <- dim(x))) arrayInd(wh, d, dimnames(x), useNames = useNames) else wh } <bytecode: 0x1021eef50> <environment: namespace:base> [[alternative HTML version deleted]]
2012 Sep 11
5
Searching from Dataframe.
Hi, i have a dataframe containing some values. for eg:- MyDataFrame<- Name Age Place ------- ------ ----------- Aby 12 USA Raj 25 UK Romi 32 ENG Amy 31 IND My requirement what is, i have a search key word[it should search from all the columns], that i need to find out from this dataframe. If search keyword found , it
2020 Oct 14
0
which() vs. just logical selection in df
...e by chance, making it slightly faster > on average? > You do not need to ask such questions. R is open source, so just look! > which function (x, arr.ind = FALSE, useNames = TRUE) { wh <- .Internal(which(x)) ## C code if (arr.ind && !is.null(d <- dim(x))) arrayInd(wh, d, dimnames(x), useNames = useNames) else wh } <bytecode: 0x7fcdba0b8e80> <environment: namespace:base> [[alternative HTML version deleted]]
2013 Jan 11
3
locating element in distance matrix
Dear useRs, I have a very basic question. I have a distance matrix and i skipped the upper part of it deliberately. The distance matrix is 1000*1000. Then i used "min" command to extract the lowest value from that matrix. Now i want to know what is the location of that lowest element? More precisely, the row and column number of that lowest element. Thanks in advance elisa
2017 Aug 24
0
functions from 'base' package are not accessible
...n "length" > > So it looks like base package is not loaded. Still if type 'which' in > console I get > function (x, arr.ind = FALSE, useNames = TRUE) > { > wh <- .Internal(which(x)) > if (arr.ind && !is.null(d <- dim(x))) > arrayInd(wh, d, dimnames(x), useNames = useNames) > else wh > } > <bytecode: 0x0000000006c6e258> > <environment: namespace:base> > > base (that contains which function) package is installed. R version is > 3.4.1 and system is Win8 > > Where should I look to u...
2011 Nov 23
9
which en un data.frame de caracteres?
Hola a todos, Tengo un "data.frame" de algunas columnas, el cual contiene objetos de tipo "character". Me interesa encontrar las coordendas de un cierto objeto dentro del "data.frame". Eso para arrays o para matrices lo hago con la función which(). Pero no consigo hacerlo para esta caso ¿alguna sugerencia para realizarlo sin tener que utilizar bucles? Gracias por
2012 Mar 29
1
Retrieving matrix column and row names by index value
Hi all, So let's say I have a matrix, mdat and I only know the index number. How do I retrieve the column and row names? For example, > mdat <- matrix(c(1,2,3, 11,12,13), nrow = 2, ncol=3, byrow=TRUE, dimnames = list(c("row1", "row2"), c("C.1", "C.2", "C.3"))) > mdat[4] [1] 12 >
2012 Mar 30
2
Finding the maximum elements in an array/matrix
Hello, I would like to find the maximum element in a matrix or an array but it does not return what I want. For example, If I have a 2*2 matrix A whose maximum element is the A(1,2). I would like the answer (1,2), but it returns 3, which is the ordinal if one counts by columns. Is there any function that returns (1,2)? Thanks > A<-rbind(c(1,4), c(3,2))> A [,1] [,2] [1,]
2012 Aug 15
1
hidden for() loop subsetting a matrix?
Hi, I am subsetting a matrix thus: test [,1] [,2] [,3] [1,] 1 7 13 [2,] 2 8 14 [3,] 3 9 15 [4,] 4 10 16 [5,] 5 11 17 [6,] 6 12 18 test[cbind(c(1,3,5), c(2,1,3))] [1] 7 3 17 This works fine, and is the equivalent of c(test[1,2], test[3,1], test[5,3]). cbind(c(1,3,5), c(2,1,3)) would obviously look like: [,1] [,2] [1,] 1 2 [2,]
2020 Oct 14
2
which() vs. just logical selection in df
Hi Dr. Snow, & R-helpers, Thank you for your reply! I hadn't heard of the {microbenchmark} package & was excited to try it! Thank you for the suggestion! I did check the reference source for which() beforehand, which included the statement to remove NAa, and I didn't have any missing values or NAs: sum(is.na(dat$gender2)) sum(is.na(dat$gender)) sum(is.na(dat$y)) [1] 0 [1] 0 [1]
2011 Nov 01
4
building a subscript programatically
Hi, On ocasion, you need to subscript an array that has an arbitrary (ie. not known in advance) number of dimensions. How do you deal with these situations? It appears that it is not possible use a list as an index, for instance this fails: > x <- array(NA, c(2,2,2)) > x[list(TRUE,TRUE,2)] Error in x[list(TRUE, TRUE, 2)] : invalid subscript type 'list' The only way I know is
2010 Apr 22
2
R2.11.0 - rasterImage() and barplot fill-patterns
...> > o On platforms with cairo but not Pango (notably Mac OS X) the > initial default X11() type is set to "Xlib": this avoids > several problems with font selection when done by cairo rather > than Pango (at least on Mac OS X). > > o New arrayInd() such that which(x, arr.ind = TRUE) for an array > 'x' is now equivalent to arrayInd(which(x), dim(x), dimnames(x)). > > > DEPRECATED & DEFUNCT > > o Bundles of packages are defunct. > > o stats::clearNames() is defunct: use unname(). > >...
2010 Apr 22
0
R 2.11.0 is released
...entered in a UTF-8 locale. o On platforms with cairo but not Pango (notably Mac OS X) the initial default X11() type is set to "Xlib": this avoids several problems with font selection when done by cairo rather than Pango (at least on Mac OS X). o New arrayInd() such that which(x, arr.ind = TRUE) for an array 'x' is now equivalent to arrayInd(which(x), dim(x), dimnames(x)). DEPRECATED & DEFUNCT o Bundles of packages are defunct. o stats::clearNames() is defunct: use unname(). o Basic regular expressions are defu...
2010 Apr 22
0
R 2.11.0 is released
...entered in a UTF-8 locale. o On platforms with cairo but not Pango (notably Mac OS X) the initial default X11() type is set to "Xlib": this avoids several problems with font selection when done by cairo rather than Pango (at least on Mac OS X). o New arrayInd() such that which(x, arr.ind = TRUE) for an array 'x' is now equivalent to arrayInd(which(x), dim(x), dimnames(x)). DEPRECATED & DEFUNCT o Bundles of packages are defunct. o stats::clearNames() is defunct: use unname(). o Basic regular expressions are defu...
2010 Oct 15
0
R 2.12.0 is released
...different format: it will be in UTF-8 on platforms using UTF-8, and otherwise in ASCII. There is also a PDF version, NEWS.pdf, installed at the top-level of the R distribution. ? kmeans(x, 1) now works. Further, kmeans now returns between and total sum of squares. ? arrayInd() and which() gain an argument useNames. For arrayInd, the default is now false, for speed reasons. ? As is done for closures, the default print method for the formula class now displays the associated environment if it is not the global environment. ? A new facility ha...
2010 Oct 15
0
R 2.12.0 is released
...different format: it will be in UTF-8 on platforms using UTF-8, and otherwise in ASCII. There is also a PDF version, NEWS.pdf, installed at the top-level of the R distribution. ? kmeans(x, 1) now works. Further, kmeans now returns between and total sum of squares. ? arrayInd() and which() gain an argument useNames. For arrayInd, the default is now false, for speed reasons. ? As is done for closures, the default print method for the formula class now displays the associated environment if it is not the global environment. ? A new facility ha...