search for: mat

Displaying 20 results from an estimated 1089 matches for "mat".

Did you mean: at
2011 Aug 21
1
Multiple R linear models into one Latex table
...s(coef(modelos[[i]]))) var.names[c(k:c(k+l-1))]<-names(coef(modelos[[i]])) k<-k+l } var.names<-unique(var.names) if(is.null(final.varnames)) { final.varnames<-var.names } if(is.null(model.names)) { model.names<-paste("Model",1:length(modelos)) } mat.all<-matrix(data=NA, nrow=length(var.names)*2, byrow=FALSE, ncol=length(model.names), dimnames=list(c(rep(c("coef","sd"),length=length(var.names)*2)), c(model.names))) dimnames(mat.all)[[1]][c(seq(1,dim(mat.all)[1], by=2))]<-var.names; dimnames(mat.all)[[1]][c(seq(2,dim(...
2017 Jan 19
2
Error en loop anidado con data.table
...a, simplificada en número de niveles por variable, para crear un ejemplo más sencillo: id anio t_8a t_10a t_12a rankf8 rankf10 rankf12 1 1 100 220 220 NA NA NA 2 1 140 350 350 NA NA NA 3 2 55 165 165 NA NA NA 4 2 60 200 200 NA NA NA 5 2 100 NA NA NA NA NA 6 3 NA 350 350 NA NA NA También tengo una matriz, "mat" con la siguiente estructura: t_8a t_10a t_12a 1 100 200 200 2 50 150 150 3 NA 250 250 La columna rankf8 la quiero rellenar tomando como referencia valores de t_8a en "datos" en relación al valor de t_8a en la matriz "mat" y según el año...
2010 Aug 03
4
Need help on upper.tri()
HI, I am really messing up to make a symmetrical matrix using upper.tri() & lower.tri() function. Here is my code:   > set.seed(1) > mat = matrix(rnorm(25), 5, 5) > mat            [,1]       [,2]       [,3]        [,4]        [,5] [1,] -0.6264538 -0.8204684  1.5117812 -0.04493361  0.91897737 [2,]  0.1836433  0.4874291  0.3898432 -0.01619...
2000 Aug 21
4
Excluding rows from a matrix
Hi I have a matrix (4 x 950) and I want to remove 3 rows, where the values from the first column are 713, 714 and 715. I can select the rows, one by one, with mat[mat$first==713,] mat[mat$first==714,] ... but I'm unable to (i) select the 3 rows at once, (ii) select the matrix excluding those rows. How can I...
2008 Oct 18
1
Error: could not find function "readMat"
Hi All, I installed this R.matlab package and tried using the sample code > > path <- system.file("mat-files", package="R.matlab") > > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > # Reading all example files > # - - - - - - - - - - - - - - - - - - - - - -...
2004 Jul 02
2
Error:length of dimnames [2] not equal to array extent ?
Hi everyone, I have the following problem: I want to perform a LDA with the function lda(). My data object mat.data is a matrix with dimensions > dim(mat.data) [1] 1228 44 and my grouping vector grp has length 1228: > length(grp) [1] 1228 Every time I call lda(), the following error message occurs: > lda(mat.data,grp) Error in lda.default(x, grouping, ...) : length of dimnames [2] not equal...
2005 Jun 14
2
Plotting rows (or columns) from a matrix in different graphs, not using "par"
...ut using the function "par" and then struggling around with "axes" and labels etc. Luckily, I would always have "rows + columns = even number" and the same "ylim". The next one could be a sort of example on what I would like to avoid plotting the rows of the matrix "mat": ########### EXAMPLE ###################### dat <- sort(runif(16, 1, 1000)) mat <- matrix(dat, ncol=4, byrow = T) y <- seq(1950, 1953) par(mfrow=c(2,2)) plot(y, mat[1,], ylim=c(1,1000), axes=F, xlab="", ylab="simul.") box() axis(side=2, tick=T,...
2013 Apr 29
1
Need help on matrix calculation
Hello again, Let say I have 1 matrix: Mat <- matrix(1:12, 4, 3) rownames(Mat) <- letters[1:4] Now I want to subscript of Mat in following way: Subscript_Vec <- c("a", "e", "b", "c") However when I want to use this vector, I am geting following error: Mat[Subscript_Vec, ] Error:...
2011 Dec 05
1
RcppArmadillo compilation error: R CMD SHLIB returns status 1
...eddelbuettel.com/blog/2011/04/23/) I get an error message. Specifically, the R code I was taking from the above example is ### BEGIN EXAMPLE ### suppressMessages(require(RcppArmadillo)) suppressMessages(require(Rcpp)) suppressMessages(require(inline)) code <- ' arma::mat coeff = Rcpp::as<arma::mat>(a); arma::mat errors = Rcpp::as<arma::mat>(e); int m = errors.n_rows; int n = errors.n_cols; arma::mat simdata(m,n); simdata.row(0) = arma::zeros<arma::mat>(1,n); for (int row=1; row<m; row++) { simdata.row(row) = simdata.row(row-...
1999 Oct 13
1
Q: sort a matrix by picking up columns?
Hi, I am wondering how to write a function which sorts a matrix by giving a vector of column numbers. Suppose we have a matrix (or data frame) "Mat" and I want to obtain order(Mat[,1], Mat[,3], Mat[,6,], Mat[,8], Mat[,10], Mat[,13]) in order to sort the matrix by those columns. Is there a way to write a function so that I can give a vector of the...
2013 Oct 03
1
prcomp - surprising structure
...a pca with over 200000 snps for 340 observations (ids). If I plot the eigenvectors (called rotation in prcomp) 2,3 and 4 (e.g. plot (rotation[,2]) I see a strange "column" in my data (see attachment). I suggest it is an artefact (but of what?). Suggestion: I used prcomp this way: prcomp (mat), where mat is a matrix with the column means already substracted followed by a normalisation procedure (see below for details). Is that okay? Or does prcomp repeat substraction steps? Originally my approach was driven by the idea to compute a covariation matrix followed by the use of eigen, but t...
2013 Sep 10
3
to delete lines by means of a vector
Hi I would like to eliminate a large number of lines of the dataframe df1 The lines to delete are given here by the values of Mat (ex : 2,4,7,10). but I have a large number (300) values of Mat dput(df1) structure(list(Mat = c(1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11), Preno...
2006 Jun 15
1
individual scales in random subset of pairwise distance survey
Hello, I'm curious if anyone has encounted a version of this problem (and it's solution) involving finding a consistent set of scales for subsets of survey data. The goal is to obtain peoples' rankings of pairwise similarity of a large number of items, on a 1..5 scale for example, and average these across people to use as input to MDS: How similar is object A to B on a 1..5
2007 Oct 16
1
library(car): Anova and repeated measures without between subjects factors
Hi, sorry if this is explained somewhere but I didn't find anything. How can I use "Anova" from the car package to test a modell without between subject's factors? Suppose I have the following data mat.1 mat.2 mat.3 di ex 1 85 85 88 1 1 2 90 92 93 1 1 3 97 97 94 1 1 4 80 82 83 1 1 5 91 92 91 1 1 6 83 83 84 2 1 7 87 88 90 2 1 8 92 94 95 2 1 9 97 99 96 2 1 10 100 97 100 2 1 11 86...
2012 Aug 21
1
About matrix manipulation
Dear list, I'm trying to create a matrix by combining the sites that species occur in a new matrix with species as rows and sites as columns. The main matrix is "mat": mat <- as.data.frame(cbind(sp1=c(rep(0, 5), rep(1, 5)),sp2=sample(c(rep(0, 6),rep(1, 4))), fac=c(rep("a", 3), rep("b", 3),rep("c&...
2016 Sep 16
3
SCEV cannot compute the trip count of Simple loop
I have modified the example test case for UB error, still it didn’t unroll void foo(int x) { int p, i = 1; int mat[9][9][9]; for (p = (x+1) ; p < (x+3) ;p++) mat[x][p-1][i] = mat[x][p-1][i] + 5; } Regard, Deepali From: Kevin Choi [mailto:code.kchoi at gmail.com] Sent: Friday, September 16, 2016 1:20 PM To: Rai, Deepali Cc: llvm-dev at lists.llvm.org Subject: Re: [llvm-dev] SCEV cannot compute the tri...
2016 Sep 16
2
SCEV cannot compute the trip count of Simple loop
Hi All, I am trying to unroll the below loop, but couldn't as SCEV returns TripCount as 0. void foo(int x) { int p, i = 1; int mat[6][6][6]; for (p = x+3 ; p<= x+6 ;p++) mat[x][p][i] = mat[x][p][i] + 5; } For a quick reference I have added the generated IR compiled with clang using -O3. Please let me know if this is an known issue in SCEV or I am missing something here ? ; Function Attrs: nounwind readnone uwtable d...
2010 Jun 19
2
Call by reference or suggest workaround
I have written code to compute multi-indices in R [1] and due to the recursive nature of the computation I need to pass around the *same* matrix object (where each row corresponds to one multi-index). As pass by reference wasn't the default behavior I declared a global matrix (mat) and used the <<- operator to write to the global matrix. So the usage would be to call genMultiIndices(3,2) for side effects to generate all multi-i...
2005 Feb 02
0
Not reproducing GLS estimates
Dear List: I am having some trouble reproducing some GLS estimates using matrix operations that I am not having with other R procedures. Here are some sample data to see what I am doing along with all code: mu<-c(100,150,200,250) Sigma<-matrix(c(400,80,16,3.2,80,400,80,16,16,80,400,80,3.2,16,80,400),n c=4) sample.size<-100 temp <- data.frame(ID=seq(...
2006 Nov 05
1
diag()<- in Matrix?
Dear all, I am trying to use the Matrix package to do some calculations on rather large and sparse matrices. An example of such a matrix is given below. mig<-0.2 side<-10 np<-side^2 mig.mat<-matrix(0,np,np) diag(mig.mat[1:(np-side),(side+1):np])<-mig/4 diag(mig.mat[(side+1):np,1:(np-side)])<-mig&...