similar to: Prefix for colnames

Displaying 20 results from an estimated 40000 matches similar to: "Prefix for colnames"

2005 Jul 26
4
elegant solution to transform vector into percentages?
Hi, I am looking for an elegant way to transform a vector into percentages of values that meet certain criteria. store<-c(1,1.4,3,1.1,0.3,0.6,4,5) # now I want to get the precentages of values # that fall into the categories <=M , >M & <=N , >N # let M <-.8 N <- 1.2 # In my real example I have many more of these cutoff-points # What I did is: out <- matrix(NA,1,3)
2009 May 17
1
[wishlist, patch] make row() and col() preserve dimnames (PR#13705)
Full_Name: Ben Goodrich Version: 2.9.0 OS: Linux (Debian unstable) Submission from: (NULL) (128.103.220.16) row(x), col(x), and functions that call them like lower.tri(x) and upper.tri(x) do not retain the rownames or colnames of x in the matrix that is returned. Example from R version 2.9.0 : x <- matrix(1:9, nrow = 3, ncol = 3) rownames(x) <- LETTERS[1:3] colnames(x) <- letters[1:3]
2012 Feb 10
1
colnames documentation
Consider the following in R 2.14.1 (seems to still be the case in Rdevel): x <- matrix(1:9, 3) colnames(x) # NULL as expected colnames(x, do.NULL = TRUE) # NULL -- since we didn't change the default colnames(x, do.NULL = FALSE) # "col1" "col2" "col3" This doesn't really seem to square with the documentation which reads: do.NULL: logical. Should this
2016 Dec 20
2
colnames for data.frame could be greatly improved
Hello, colnames seems to be not optimized well for data.frame. It escapes processing for data.frame in if (is.data.frame(x) && do.NULL) return(names(x)) but only when do.NULL true. This makes huge difference when do.NULL false. Minimal edit to `colnames`: if (is.data.frame(x)) { nm <- names(x) if (do.NULL || !is.null(nm)) return(nm) else
2017 Dec 27
1
Error in dimnames in R
Could anyone help me with some little problem? When I plot the frontier I get the following message: *"Error in dimnames(x) <- dn : length of 'dimnames' [1] not equal to array extent"*(see below for detail). How could I solve this. Thanks a lot. ##---------------------------- Portfolio construction & Optimisation------------------------ #Assets: LUTAX,
2007 Nov 26
2
colnames slow (PR#10470)
Full_Name: Tomas Larsson Version: 2.6.0 OS: Windows XP Submission from: (NULL) (198.208.251.24) This is not a bug, it is a performance issue but I think it should have an easy fix. I have a large matrix (about 2,000,000 by 20), when I type colnames(x) it takes a long time to get the result. However, if I select just the first couple of rows of the matrix I don't have to wait for the
2004 Aug 20
3
Loss of rownames and colnames
Hi, I am working on some microarray data, and have some problems with writing iterations. In essence, the problem is that objects with three dimensions don't have rownames and colnames. These colnames and rownames would otherwise still be there in 2 dimensional objects. I need to generate multiple iterations of a 2 means-clustering algorithm, and these objects thus probably need 3
2014 Jul 22
2
Ayuda Error in `colnames<-`(`*tmp*`, value = c(
Buenas tardes, grupo. Estoy tratando de hacer la comparación de dos archivos de una misma organización para encontrar las diferencias entre su informe del tema edl año 2005 y el del año 2013: Todos los comandos van bien, a exepción del último "colnames", como se ve en la siguiente secuencia: > pdf1<-"./PLAN de INSPECCIONES/05_seguridad_ciudadana.pdf" >
2013 Feb 23
2
assign index to colnames(matrix)
Hello, I’m trying to follow the syntax of a script from a journal website. In order to create a regression formula used later in the script, the regression matrix must have column names “X1”, “X2”, etc. I have tried to assign these column names to my matrix ScoutRSM.mat using a for loop, but I don’t know how to interpret the error message. Suggestions? Thanks, Paul
1998 Nov 09
1
Proposal for discussion: COLNAMES & ROWNAMES
Looking into several different parts of R../src/library/base/R/*.R has led me to the conclusion that quite a bit of code doubling could be saved by using the following two functions whose naming philosophy is derived from that of NROW() & NCOL(): COLNAMES <- function(x) if(is.null(n <- colnames(x))) paste(seq(length=NCOL(x))) else n ROWNAMES <- function(x)
2011 Nov 21
1
readDGE: Error in colnames/length of dimnames not equal to array extent
Hello, all, I'm a new R user (new to any programming language in general, really), so I apologize if this is easy/has already been answered (I've attempted searching online but did not understand the pages I found). My data is stored in text files with the headers LANE, RNA_NAME, SEQ, and SEQCNT. I've been using x = "filename.txt" y = aggregate(x$SEQCNT, list(x$RNA_NAME),
2005 Jun 07
1
ordglm -- simple question
My attempt to test a model using ordglm code is running into problems, and I thought if you have a moment you might illucidate the situation. Here is the data: http://www.people.fas.harvard.edu/~corr/6.4.05.RData Here is the code: # I coerce tcn8 matrix data to a vector, because ordglm will not accept matrix data. y<-as.vector(tcn8[,62]) x<-as.vector(tcn8[,60])
2006 Mar 21
1
rownames, colnames, and date and time
I noticed something surprising (in R 2.2.1 on WinXP) According to the documentation, rownames and colnames are character vectors. Assigning a vector of class POSIXct or POSIXlt as rownames or colnames therefore is not strictly according to the rules. In some cases, R performs a reasonable typecast, but in some other cases where the same typecast also would be possible, it does not. Assigning a
2006 Mar 21
1
rownames, colnames, and date and time
I noticed something surprising (in R 2.2.1 on WinXP) According to the documentation, rownames and colnames are character vectors. Assigning a vector of class POSIXct or POSIXlt as rownames or colnames therefore is not strictly according to the rules. In some cases, R performs a reasonable typecast, but in some other cases where the same typecast also would be possible, it does not. Assigning a
2009 Feb 02
1
Assigning colnames in loop
Dear R-listers, I am trying to assign colnames to a data frame within a loop, but I keep getting a "target of assignment expands to non-language object"-error. I need to split up a large dataset into about 20 smaller ones, and I would like to assign colnames within the loop, so I won't have to type the same thing 20 times over. I have concocted this really goofy example which
2010 Sep 27
3
name ONLY one column
Hi R-users I can not change the name of one column only of my matrix. my_matrix <- matrix (1:12,ncol=3) colnames(my_matrix)[1] <- 'myname' Error in dimnames(x) <- dn : length of 'dimnames' [2] not equal to array extent thank you for your help Lorenzo [[alternative HTML version deleted]]
2012 May 22
1
Naming dimnames in an array using the results of an expression
dear all i'm struggling with naming in an array diag.data is one of a series of 2x2 diagnostic testing arrays, with 'Outcome' columns (true/false) and 'Test' rows (High-risk, Low-risk), drawn from a larger list object of 'results' i can hard-code the names of the array using dimnames; diag.data<-array(c(19,2,125,50),c(2,2)) #example to run - actually comes out
2010 Jul 19
3
concatenating column names in a loop
Hi all, I am trying to concatenate words together to create new column names, using a loop. Please consider the following toy example: x <- matrix(nrow = 1, ncol = 3) colnames(x) <- c("a", "b", "c") x[1,1] <- "1" x[1,2] <- "2" x[1,3] <- "3" I would like to create a new matrix with column names based on the column names
2006 Aug 08
3
Pairwise n for large correlation tables?
Hello, I'm using a very large data set (n > 100,000 for 7 columns), for which I'm pretty happy dealing with pairwise-deleted correlations to populate my correlation table. E.g., a <- cor(cbind(col1, col2, col3),use="pairwise.complete.obs") ...however, I am interested in the number of cases used to compute each cell of the correlation table. I am unable to find such a
2008 Mar 13
1
Convert a List of Distances to a Distance Matrix
Hello, Is there an easy function for switching list to matrix. My list is of genetic distances between species pairs: A A 0 A B .5 A C .25 B C .5 and I want a distance matrix such as: A B C A 0 .5 .25 B .5 0 .5 C .25 .5 0 for use in a mantel test. Thank you for the help! cheers, charlie -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Charles G. Willis Department of Organismic