similar to: Weird behavior of a 2-by-2 matrix indicies

Displaying 20 results from an estimated 10000 matches similar to: "Weird behavior of a 2-by-2 matrix indicies"

2011 Feb 26
1
Wired behavior of a 2-by-2 matrix indicies
Dear R, I found a very wired behavior for a 2-by-2 matrix, see this example > A <- matrix(1:4, 2) > idx4A <- matrix(1:4, 2) > A[idx4A] Error in A[idx4A] : subscript out of bounds But other matrices are fine, > B <- matrix(1:9, 3) > idx4B <- matrix(1:9, 3) > B[idx4B] [1] 1 2 3 4 5 6 7 8 9 I can reproduce this for both 32bit windows and 64bit linux with R 2.12.1
2018 Mar 17
0
length of 'dimnames' [2] not equal to array extent- For Correlation Plot
That does clarify for me that you're missing a step: I didn't clearly follow your description at first. corrplot expects a correlation matrix, not your original data. You need to use cor() first. That's pretty clear in the documentation. See for instance the examples: data(mtcars) M <- cor(mtcars) corrplot(M) Sarah On Sat, Mar 17, 2018 at 12:00 PM Shivi Bhatia <shivipmp82 at
2016 Apr 15
0
Decision Tree and Random Forrest
Since you only have 3 predictors, each categorical with a small number of categories, you can use expand.grid to make a data.frame containing all possible combinations and give that the predict method for your model to get all possible predictions. Something like the following untested code. newdata <- expand.grid( Humidity = levels(Humidity), #(High, Medium,Low)
2011 Jul 29
3
help with plot.rpart
? data=read.table("http://statcourse.com/research/boston.csv", , sep=",", header = TRUE) ? library(rpart) ? fit=rpart (MV~ CRIM+ZN+INDUS+CHAS+NOX+RM+AGE+DIS+RAD+TAX+ PT+B+LSTAT) Please: Show me the tree. Mark -------- Original Message -------- Subject: Re: [R] help with rpart From: "Stephen Milborrow" <[1]milbo at sonic.net>
2012 Mar 11
0
[R-sig-eco] Landscape ecology in R
Hi Manuel, I've taken the liberty of adding the r-help list back to this email, even though you sent your reply just to me, so that others may contribute. On Fri, Mar 9, 2012 at 6:27 PM, Manuel Sp?nola <mspinola10 at gmail.com> wrote: > Thank you Sarah, > > I am thinking more on?habitat mapping and landscape metrics. Then you've probably seen the adehabitat* and SDMTools
2012 Jun 19
0
[R-sig-Geo] Help in simultaneous equations
On Tue, Jun 19, 2012 at 1:11 PM, Saima Bashir <saimabashir11 at yahoo.com> wrote: > Hi Sarah, > > I have installed and loaded them into R but get same error. > > I am using four equations, cross-section data, version R i386 2.15.0. That is by no means all the information I requested in my original reply, or all that is requested in the posting guide. Nobody can help you
2011 Jul 29
1
help with predict.rpart
? data=read.table("http://statcourse.com/research/boston.csv", , sep=",", header = TRUE) ? library(rpart) ? fit=rpart (MV~ CRIM+ZN+INDUS+CHAS+NOX+RM+AGE+DIS+RAD+TAX+ PT+B+LSTAT) predict(fit,data[4,]) plot only reveals part of the tree in contrast to the results on obtains with CART or C5 -------- Original Message -------- Subject: Re: [R] help with rpart From: Sarah
2008 Jun 10
0
TR : Probs with paste
Thanks for the messages. What I probably should have explained is that I have a data.frame "file" with variables named "A", "B", etc.. I wanted to use paste () to pull the names "file$A", "file$B", etc. and stick them in table() and so get an output of table(file$A). For the record, someone read my thinking and sent the following solution which
2016 Apr 15
1
Decision Tree and Random Forrest
I need the output to have groups and the probability any given record in that group then has of being in the response class. Just like my email in the beginning i need the output that looks like if A and if B and if C then %77 it will be D. The examples you provided are just simply not similar. They are different and would take interpretation to get what i need. On Apr 14, 2016 1:26 AM,
2016 Apr 14
3
Decision Tree and Random Forrest
I still need the output to match my requiremnt in my original post. With decision rules "clusters" and probability attached to them. The examples are sort of similar. You just provided links to general info about trees. Sent from my Verizon, Samsung Galaxy smartphone<div> </div><div> </div><!-- originalMessage --><div>-------- Original message
2011 Aug 01
1
Inserting column in between -- "better" way?
Folks: I consider my reply below rather clumsy: One has to keep track of index numbers other than that which is inserted and must separately change column names. Is there as "essentially better" way to do this, either via base R or via an R package. I leave it to you to define "essentially better." Thanks. Cheers, Bert On Mon, Aug 1, 2011 at 10:17 AM, Bert Gunter
2010 Feb 05
0
remove a row from a dataframe, row names disappear - solution
Thank you Sarah.I'm glad it was a quick fix: On Fri, Feb 5, 2010 at 8:50 AM, Sarah Goslee <> wrote: > You're not only removing a row of data, you are invoking the default > behavior of subset, which is to collapse the subsetted result to the > smallest possible type, which in this case is a vector. Vectors have > no rows, and thus no row names. > > You need the
2011 Jan 29
1
Spare matrix multiplication
Dear R, I have a simple question concerning with a special case of spare matrix multiplications. Say A is a 200-by-10000 dense matrix. B is a 10000-by-10000 block- diagonal matrix, and each diagonal block B_i is 100-by-100. The usual way I did A%*%B will take about 30 seconds which is to time consuming because I have to do this thousands of times. I also tried to partition A into 100 small blocks
2011 Dec 12
1
how to colour labels (each label with a colour) in a dendrogram?
Hello to all, I still have this doubt. I'd like to colour the different labels of my dendrogram each one with a different colour. How can I do? I guess I could do using *edgetext* and then *t.col* or* lab.col* but I don't know how to add edgetext to my dendrogram. Can you help me please? Example: require(graphics); require(utils) hc <- hclust(dist(USArrests), "ave") (dend1
2011 Aug 03
0
Combining multiple dependent variables for machine learning -- fortunes candidate?
I thought Sarah's reply was great and, alas, should probably be templated for this list. Not sure it fits as a fortunes package entry, but I thought it at least worthy of consideration. Cheers, Bert >> ... >> I appreciate any suggestions for this problem. Sarah Goslee replied: > Suggestions? Yes. Read the posting guide and follow it. It isn't clear that > this is even
2011 Jan 18
2
Convert a matrix's columns to list
Dear R, Is there an efficient way to make a list that each element is from the corresponding column of a matrix. For example, if I have a matrix "a" > a <- matrix(1:10, 5, 2) > a [,1] [,2] [1,] 1 6 [2,] 2 7 [3,] 3 8 [4,] 4 9 [5,] 5 10 I would like to have a list "b" like this > b <- list(a[, 1], a[, 2]) > b [[1]] [1] 1 2 3
2013 Jan 14
2
The three-dot question
Dear all, Why does not the three-dot accept arguments from the parent environment? I am just confused with this error, can someone give me a hint? > rm(list=ls()) > testFun <- function(a, ...) + { + if(a){ + print(a) + }else + { + print(b) + } + } > > myTask <- function(a) + { + b <- 3 + testFun(a, b = b) + } >
2010 Oct 12
1
lapply to subsets
Dear R, I have a silly question concerns with *apply. Say I have a list called A, A <- list(a = array(1:20, c(2, 2, 5)), b = array(1:30, c(2, 3, 5))) I wish to calculate the mean of A$a, and A$b w.r.t. their third dimension so I did lapply(A,apply,c(1,2),mean) Now if I still wish to do the above task but take away some burn-in, e.g. do not take A$a[,,1:2],and A$b[,,1:2] into account.
2009 Nov 05
2
rm(list<-ls()) error
Dear R, Why rm(list<-ls()) gives an error but rm(list=ls()) not?. I remember the operator ‘<-’ can be used anywhere... Thanks! Feng -- Feng Li Department of Statistics Stockholm University 106 91 Stockholm, Sweden http://feng.li/ [[alternative HTML version deleted]]
2010 Jan 05
1
R-package related to the topic of INARMA models
Dear R, I am looking for R-package related to INARMA (Integer-valued ARMA). Can anyone give me some information? I did not get information from task view. Many thanks. Feng -- Feng Li Department of Statistics Stockholm University 106 91 Stockholm, Sweden http://feng.li/ [[alternative HTML version deleted]]