similar to: assign colnames to data

Displaying 20 results from an estimated 20000 matches similar to: "assign colnames to data"

2010 Mar 15
0
Fw: assign colnames to data
Patrick, Thanks. I tried colnames, but it doesn't work. Seems more transformation is needed. But now I got names, that's good enough. Best. Xumin Patrick Burns <pburns@pburns.seanet.com> 03/15/2010 04:04 PM To Xumin Zeng <xumin.zeng@abbott.com> cc Subject Re: [R] assign colnames to data Those are names, not colnames. See the 'More R key actions' page
2010 Mar 08
2
how to convert character variables into numeric variables directly
Here is the example. > age=18:29 > height=c(76.1,77,78.1,78.2,78.8,79.7,79.9,81.1,81.2,81.8,82.8,83.5) > type=c("A", "B", "C", "D","A", "B", "C", "D","A", "B", "C", "D") >
2008 Jun 19
3
colnames of a column
Hi, With this data.frame: > class(rwl) [1] "data.frame" >rwl 0028002F 0028013F 0028032F 1833 3.39 NA NA 1834 3.09 NA NA 1835 3.05 NA NA 1836 3.31 NA NA 1837 2.26 NA NA > colnames(rwl) [1] "0028002F" "0028013F" "0028032F" Ok.... > colnames(rwl[,1]) NULL why??
2010 Jan 20
1
sum column by colnames
Hi, I've this dataframes: > data1 1 2 3 4 5 6 5 0.4963017 0 0 0.2481509 1.9852069 0.4963017 10 0.0000000 0 0 0.0000000 0.6317266 0.0000000 15 0.0000000 0 0 0.0000000 0.0000000 0.0000000 20 0.0000000 0 0 3.3955301 0.0000000 0.0000000 25 0.0000000 0 0 0.0000000 0.0000000 0.0000000 30 0.0000000 0 0 0.0000000 0.0000000
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
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
2004 Dec 21
1
about colnames
Try colnames(df)[4:6] <- c("x","y","z") -----Original Message----- From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of xmeng at capitalbio.com Sent: 21 December 2004 09:45 To: r-help at stat.math.ethz.ch Subject: [R] about colnames Hello sir: If there's a data frame(with name "df"): a b c d e f
2005 Jul 20
3
Prefix for colnames
Hi, I would like to add a prefix to colnames in a matrix but I can't get the prefix option in colnames to work. What am I doing wrong? > X<-matrix(NA,3,4) > colnames(X)<-c("test","test","test","test") > colnames(X)<-colnames(X,prefix="PREFIX.") > X test test test test [1,] NA NA NA NA [2,] NA NA NA NA
2017 Oct 23
2
A list of data frames and a list of colnames.
I have a list of file names, and a list of data frames contained in those files. mynames <- list.files() mydata <- lapply(mynames, read.delim) Every file contains two columns. > colnames(mydata[[1]]) [1] "Name" "NumReads" > colnames(mydata[[2]]) [1] "Name" "NumReads" I can set the colnames easily enough with a for loop. for (i in
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
2010 Mar 17
2
Retaining variable name in a function
Hi All, Im interested in creating a function that will convert a variable within a data.frame to a factor while retaining the original name (yes, I know that I can just: var <-factor(var) but I need it as a function for other purposes). e.g.: # this was an attempt but fails. facts <- function(meta, mod, modname = "spec") { meta$mod <- factor(meta$mod)
2006 Nov 06
1
colnames and get means for the columns with the "same" names
hi, I have a conversion table for colnames like this: Probe_ID HUMAN_LLID 1 AF106325_PROBE1 7052 2 NM_019386_PROBE1 7052 3 NM_012907_PROBE1 339 4 AW917796_PROBE1 84196 5 L27651_PROBE1 10864 The Probe_ID contains a list of colnames for another data.frame, say x1. I need to convert such colnames to another ID's system, HUMAN_LLID by using the table.
2006 Jul 03
1
rownames, colnames, and date and time
Hi all I was wondering whether there has ever been an update on the rownames and colnames behaviour as described by Eric below? I still get the same behaviour, exactly as described by Eric, on my WinXP installation of R-2.3.0. I also posted a message to r-help on Friday but looking through the online archives it seems to have not made it to the list. I would agree with Eric that a consistent
2016 Apr 03
2
row.names(), rownames(), colnames(), names() ...?
The help text for row+colnames {base} states: "For a data frame, rownames and colnames eventually call row.names and names respectively, but the latter are preferred." Why are they "preferred"? Why is it names(), not col.names()? I have only ever used names() for vectors - I'm surprised it works on data.frames... IMO this is not great for code readability, thus
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
2016 Apr 03
0
row.names(), rownames(), colnames(), names() ...?
Data frames are lists of columns. The names() function is appropriate for lists. It doesn't pay to fall into the trap of thinking that data frames are truly symmetric between columns and rows, because there is a performance penalty for accessing rows that is greater than the cost of accessing columns. With that in mind, thinking of data frames as lists is preferred, so names is preferred
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
2008 Jun 14
1
Correcting the display of colnames and rownames
Dear all, I have a data frame of dimension 720 columns by 360 rows, to which I am trying to add numerical row and column labels to, using the 'sequence' command. The original data, which I read in using 'read.table', had no such labels at all. I've got as far as successfully using the sequence command and getting the labels to display. However, I'm finding that for the
2011 Aug 10
2
join columns
Dear R-help, I wonder if you could give me some suggestions in how to do a union join of two data frames as follow: -> union join the common column, and insert a 0 if one is missing. I made a function to perform the following, and I know it may not that quite welly written, but it works. Any suggestions are welcome, many thanks. Anthony > q1 =