[R] combine venn diagram and pie chart

2009-08-02 Thread kevinchang
Hi R users, I am wondering if it there is R's function that can help integrate venn diagram and pie chart to compare two related datasets. I know the package limma has something built-in for making venn diagram, but I guess it would be very painful to use line and text to specify the proporti

[R] locate substring in the string it belong to

2009-07-20 Thread kevinchang
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

[R] save the layout using igraph

2009-03-03 Thread kevinchang
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 excep

Re: [R] layout of igraph

2009-02-26 Thread kevinchang
am not sure what is the "correlation between two nodes". You mean > that the graph is weighted? > > If you have a small graph, then you can refine the layout > interactively by using 'tkplot'. > > Gabor > > On Thu, Feb 26, 2009 at 4:20 PM, kevinchang wr

[R] layout of igraph

2009-02-26 Thread kevinchang
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 clos

[R] conversion of data structure between R and Perl

2008-08-27 Thread kevinchang
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 pa

[R] flops calculation

2007-10-28 Thread kevinchang
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 measu

Re: [R] Newton method iteration problem

2007-10-27 Thread kevinchang
C. Berry wrote: > > On Fri, 26 Oct 2007, kevinchang wrote: > >> >> 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 >

[R] Newton method iteration problem

2007-10-26 Thread kevinchang
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 acc

[R] inverse of matrix made by low.tri function

2007-10-03 Thread kevinchang
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

[R] function for special matrix design

2007-10-01 Thread kevinchang
Hi All, I am trying to make a matrix with a particular value for all the elements above and including diagonal and another particular value for all the elements below diagonal. Obviously , Matrix function in Matrix package does not work since it only allow filling by either row or column. So I am

[R] stalled loop

2007-09-16 Thread kevinchang
Hey everyone, The code 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 a lot for your time. #a simplified version of the code a<-c("superman" , "xman" , "spiderman" ,"wolfman" ,"mansuper

[R] stalled loop

2007-09-16 Thread kevinchang
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

[R] naming columns of data frame

2007-09-15 Thread kevinchang
Hey, I am trying to make a data frame and the name of a column is composed of a number, a dot, and a word, such as "1.whatever". But I always get this error message:"syntax error, unexpected SYMBOL, expecting ',' in:" while printing data frame out . When I rename the column with purely letter, ev

[R] starting with a capital letter

2007-09-15 Thread kevinchang
Hi everyone, I am wondering if there is any built-in funcion that can determine whether words in a character vector start with a captial letter or not. Help, please. Thanks. -- View this message in context: http://www.nabble.com/starting-with-a-capital-letter-tf4447302.html#a12689105 Sent from

[R] locate word in vector

2007-09-14 Thread kevinchang
Hey All, I am wondering if there is a built-in function allowing us to locate a particular word in a character vector. ex: vector a a [1] "superman" "xamn" "spiderman" "superman" "superman" "xman" [7] "spiderman" Is there any built-in function that can show "superman" are the fir

[R] rearrange problem

2007-09-13 Thread kevinchang
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 t

[R] alternative way to loop

2007-09-11 Thread kevinchang
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 con