similar to: naming columns of data frame

Displaying 20 results from an estimated 11000 matches similar to: "naming columns of data frame"

2009 Feb 26
1
layout of igraph
Dear R users, I am trying to draw a network using igraph package. I intend to place the hub nodes (the ones with the relatively more connection with other nodes) in the center of the graph. Also, the graph need to be in the fashion that the higher the correlation between two nodes is , the closer the two nodes will be. Is there any layout that can help or any other way to do this? Thanks in
2009 Mar 03
1
save the layout using igraph
Hi R users, I am using built-in functions in igraph package to draw networks . I need to compare several network with exactly the same structure but with edge hightlighted differently. I am wondering if there is a way to save the layout so that every graph will look the same as each other except for the colors of edges. Or is there any parameter I can set for this purpose?? Thanks in advance,
2009 Aug 03
2
combine venn diagram and pie chart
Hi R users, I am wondering if it there is any R's function helping integrate venn diagram and pie chart to compare two related datasets. I know the package limma(bioconductor) has something built-in for making venn diagram, but I guess it would be very painful to use line and text to specify the proportions in the fashion of pie chart . Thanks in advance, Kevin Chang -- View this
2007 Oct 29
2
flops calculation
Hi all, Since proc.time return three different kind of times (user, system and elapsed) , I am wondering which one is right for calculating flops. In New S Language (Becker et. al. ) , it seems to be the user because " the user time measures the processor time used in S and the system time measures the operating system in response to S's request". But in R Help , system time
2007 Sep 13
1
rearrange problem
Hi All, I am trying to rearrange alphabetically each element in a character vector. ex: say the first element in the vector is "cba", and my goal is to turn it into "abc". The suggested function to use is sort(). But it turns out that sort doesn't work at the level of element. So I am wondering that if there is an alternative function for this purpose. Please help me out .
2007 Sep 16
2
stalled loop
Hi, The loop I wrote executes correctly but is stalled seriously. Is there a way to hasten execution without coming up with a brand new algorithm ? please help. Thanks. -- View this message in context: http://www.nabble.com/stalled-loop-tf4451301.html#a12699524 Sent from the R help mailing list archive at Nabble.com.
2009 Jul 20
1
locate substring in the string it belong to
Hi R users, I am trying generate the indices for locating a in the string it come from. Given the length of the string, it will take too long using the combn() for further comparison. I am wondering if R has any built-in function for this purpose. To make it concrete: this.substring="cc" this.string="ccc" start.location=1,2 end.location=2,3 Thanks in advance, Kevin
2008 Jan 08
2
problem when extacting columns of a data frame in a new data frame
Dear R-users, I would like to create a new data frame composed of 2 columns of another data frame. But it does not give me what I want... > casesCNST[1:10,] case X1 X2 X3 X4 expected 1 A1 0 0 0 0 E 2 A2 0 0 0 1 C 3 A3 0 0 0 2 C 4 A4 0 0 0 3 C 5 A5 0 0 0 4 C 6 A6 0 0 1 0 C 7 A7 0 0 1 1 C 8
2023 May 08
1
data.frame with a column containing an array
Dear list members, when I create a data.frame containing an array I had expected, that I get a similar result, when subsetting it, like having a matrix in a data.frame. But instead I get only the first element and not all values of the remaining dimensions. Differences are already when creating the data.frame, where I can use `I` in case of a matrix but for an array I am only able to insert it in
2000 Sep 14
1
dynamically naming columns in a data frame
Hello All! I have been working with R for the last couple of weeks and I am very impressed with the capabilities. I am creating hundreds of tables and need to dynamically name the columns. Here is a small snippet of my code: # Turn my clustering data into a data.frame object. names( clusters ) <- Abbreviate( distMethods[ i ], hclustMethods[ j ] ) df <- data.frame( clusters,
2008 Apr 07
2
Naming rows oe columns in a data frame.
Hello there! I have a really basic question. I have extracted some data from a big database. I have ordered the data in to different agegroups in the rows. Now I want to to have labels of the columns which is going to be divided into men , women and totals. How do I give names to a column? My data looks like this for the moment; 0-39 12 34 43 40-49 14 23 23 50-59 16
2012 Feb 17
5
How to change the order of columns in a data frame?
Dear all, I have a data frame in which the columns need to be ordered. The first column X is at the right position, but the remaining columns X1-Xn should be ordered like this: X1, X2, X3 etc instead of like below. > colnames(pos1) [1] "X" "X1" "X10" "X11" "X12" "X13" "X14" "X15" "X16"
2007 Sep 11
1
alternative way to loop
I heard that if-loop may result in errors if we are going to loop for a lot of times. And sum() can be the alternative way to do this kind of hugbe looping. But I haven't figure out how . Can someone please give me an concrete example of using sum() for this purpose? -- View this message in context: http://www.nabble.com/alternative-way-to-loop-tf4422299.html#a12613696 Sent from the R help
2008 Aug 27
1
conversion of data structure between R and Perl
Dear R users, I am trying to call a Perl subroutine from R . The subroutine returns an arrray contaning three elements wihch are all strings. But the calling in R return an integer which is 0. I have no idea how this could happen. Maybe becasue I shouldn't use system() in R or I should load a particular package for my R in windows. Please help ....
2007 Oct 03
1
inverse of matrix made by low.tri function
Hi all, I am using R trying to get a inverse matrix of (X^T)X , but I keep getting the error message like: no b argument and no default value for sprintf(gettext(fmt, domain = domain), ...) . -------------------------------------------------------------------------------------------- # my code X<-Matrix(rep(1,500),100,5) X[lower.tri(X)]<-1-10^-7 XtX<- t(X)%*% X XtXu<-lu(XtX)
2007 Oct 27
1
Newton method iteration problem
Hi all, I am coding for finding the root of f(x)= phi(x) -alpha where phi(x) is the cumulative density function and alpha is constant . The problem right now is I can't get the "initialX" representing the root out of the while loop when ending , it seems to me it disappear when the loop ends accroding to the error message. I need help . Please suggest the cause or solution to this
2005 Jan 14
5
Replacing NAs in a data frame using is.na() fails if there are no NAs
Hi This is a difference between the way matrices and data frames work I guess. I want to replace the NA values in a data frame by 0, and the code works as long as the data frame in question actually includes an NA value. If it doesn't, there is an error: df <- data.frame(c1=c(1,1,1),c2=c(2,2,NA)) df[is.na(df)] <- 0 df df <- data.frame(c1=c(1,1,1),c2=c(2,2,2)) df[is.na(df)] <-
2006 Nov 08
0
Fw: data frames re-ordering and naming columns
Thank you for help with the first part. The second part I do not understand. All I get is "3" "3". Presumably this is the factor that you refer to. Is there no simple way of extracting the text alone ----- Forwarded Message ---- From: Peter Alspach <PAlspach@hortresearch.co.nz> To: Jabez Wilson <jabezwuk@yahoo.co.uk> Sent: Tuesday, 7 November, 2006 7:46:02 PM
2011 Nov 03
2
Take variables in data.frame and create list of matrices
Hi, I have this sample data below and would like to create a list of matricies. setseed(1254) id <- c(1,1,1,1 ,2,2,2) o <- as.factor(c(1:4, 1, 3, 4)) r <- rep(.5, 7) v <- rnorm(7) s <- rnorm(7) dat <-data.frame(id, o, r, v, s) dat #> dat # id o r v s # 1 1 0.5 0.7024631 2.0813672 # 1 2 0.5 -0.5541955 0.1095156 # 1 3 0.5 -1.0418167 0.4164930 # 1
2005 Feb 08
4
Renaming columns in data.frame, inserting/removing columns from data.frame
Hello, I'm hoping that there is an easier way to rename columns in a data frame other than by using the names() assignment, which requires you to type in all the column names at once for a data.frame, in the case that I simply want to rename a single column in a data frame. Also, is there an easy way to move columns in a data frame around relative to the other columns? Thanks in