[R] how to adding colors to data points in scatter plot in R?

2009-05-23 Thread Tim LIU
Does anybody know how to adding colors to data points in scatter plot in R? I have the following R data frame - Voter_Name, Education_years, Income, Registered Ricky, 18, 4, Y Lisa, 20, 34000, N Jon, 10, 35000, Y ... I am doing a scatter plot in R for those data points - Income vs.

Re: [R] Clean up a complex variable

2009-05-23 Thread andyer weng
Dear all, I need to clean up one variables in a dataset. e.g. lets say the dataset is trial, the variable for cleaning up is V1 trial$V1 [1] 0(a=1) 0(b=1) 0.133(b=1) 0.555(a=1) 5.32(a=1) what i need to do is to remove the text (a=1) and (b=1) and the in the V1, and then convert to a numeric

[R] Draw a rectangle on top of an image using RGtk2?

2009-05-23 Thread Ronggui Huang
Dear all, I use gtkImageFromFile to display an image. Then I want to do some gsignal to handle mouse event. I click the mouse and move a another position and release. I can get the position of the firs click and the release position, then I would to draw a rectangle to display the region I have

Re: [R] how to adding colors to data points in scatter plot in R?

2009-05-23 Thread ONKELINX, Thierry
Dear Tim, Have a look at the ggplot2 package. library(ggplot2) ggplot(your.data.frame, aes(x = EducationYears, y = Income, colour = Registered)) + geom_point() You find a lot of examples at the ggplot2 website: http://had.co.nz/ggplot2/ HTH, Thierry

Re: [R] Negative value for adjustedRandIndex?

2009-05-23 Thread Gavin Simpson
On Thu, 2009-05-21 at 05:28 -0700, Pooka wrote: Hello, I am a very new user to R so please have patience with me. :clap: I am trying to evalute the internal response for a couple of different cluster methods with the help of the AdjustedRandIndex, which is included in the mclust package.

Re: [R] Clustered data with Design package--bootcov() vs. robcov()

2009-05-23 Thread jjh21
Another question related to bootcov(): A reviewer is concerned with the fact that bootstrapping the standard errors does not give the same answers each time. What is a good way to address this concern? Could I bootstrap, say, 100 times and report the mean standard error of those 100 estimates? I

[R] Constraining linear regression model

2009-05-23 Thread Jean-Paul Kibambe Lubamba
Hi All, I have two questions: I am computing a linear regression model with 0 as Intercept. Well, I would like the sum of my predicted values be equal to a constant and therefore analyze if my coefficients are significatively different using or not this constraint. Does anyone know how I can

Re: [R] automatic model selection based on BIC in MLE

2009-05-23 Thread Gavin Simpson
On Thu, 2009-05-21 at 20:47 -0700, Michael wrote: Hi all, Could anybody point me to an automatic model selection based on BIC for my MLE fitting problem, in R? ?stepAIC I would imagine I just have to supply the MLE LLF function, and the dimension of the problem and the number of

Re: [R] Clustered data with Design package--bootcov() vs. robcov()

2009-05-23 Thread Frank E Harrell Jr
jjh21 wrote: Another question related to bootcov(): A reviewer is concerned with the fact that bootstrapping the standard errors does not give the same answers each time. What is a good way to address this concern? Could I bootstrap, say, 100 times and report the mean standard error of those

Re: [R] how to adding colors to data points in scatter plot in R?

2009-05-23 Thread Matthieu Dubois
Simply use the col paramater, with a factor to index the colors. Example: # generate some data x - rnom(100) y - rnorm(x) z - as.factor(rbinom(x,1,0.5)) # plot plot(x,y, col=c('red','blue')[z]) HTH, Matthieu __ R-help@r-project.org mailing list

Re: [R] Error: C stack usage is too close to the limit (can't understand explanations of how to fix this)

2009-05-23 Thread goon83
you can find the R_CStackLimit in Rinterface.h after that you will know how to use it! ÔÚ2009-05-21?17:53:54£¬anon36?ano...@yahoo.com?дµÀ£º Apparently?the?way?to?deal?with?this?error?message?is?to?set ??R_CStackLimit?=?(uintptr_t)-1

Re: [R] Constraining linear regression model

2009-05-23 Thread Peter Flom
Jean-Paul Kibambe Lubamba jean-paul.kiba...@uclouvain.be wrote I have two questions: I am computing a linear regression model with 0 as Intercept. Well, I would like the sum of my predicted values be equal to a constant and therefore analyze if my coefficients are significatively different

[R] counting occurrence of text in a dataframe

2009-05-23 Thread Iain Gallagher
Hello list. I am hoping for some help with a relatively simple problem. I have a data frame arranged as below. I want to be able to count the occurrence of each gene (eg let-7e) by Experiment. In other words how many times does a given gene crop up in the dataframe. I tried table but couldn't

Re: [R] Draw a rectangle on top of an image using RGtk2?

2009-05-23 Thread Michael Lawrence
On Fri, May 22, 2009 at 11:27 PM, Ronggui Huang ronggui.hu...@gmail.comwrote: Dear all, I use gtkImageFromFile to display an image. Then I want to do some gsignal to handle mouse event. I click the mouse and move a another position and release. I can get the position of the firs click and

Re: [R] counting occurrence of text in a dataframe

2009-05-23 Thread Gabor Grothendieck
Try this: Lines - Tanaka Mitchell Wang Hunter Chen Chim miR-191* let-7e let-7b miR-126let-7a let-7g miR-198let-7f let-7c miR-146a let-7b let-7i miR-22 let-7g miR-1224 miR-16 let-7d miR-130b miR-223let-7i miR-124

Re: [R] counting occurrence of text in a dataframe

2009-05-23 Thread Stefan Grosse
On Sat, 23 May 2009 12:44:19 + (GMT) Iain Gallagher iaingallag...@btopenworld.com wrote: IG I am hoping for some help with a relatively simple problem. I have IG a data frame arranged as below. I want to be able to count the IG occurrence of each gene (eg let-7e) by Experiment. In other words

[R] optimizing function over x,y

2009-05-23 Thread Esmail
Hello all, I would like to maximize or minimize a given math function over a specific set of values. I was checking out Wolfram Alpha (http://www70.wolframalpha.com/) and it can do simple optimization problems in math, such as maximize 15*x - x**2 over 0 to 15

[R] Luis Miguel Delgado Gomez/BBK está ausente d e la oficina.

2009-05-23 Thread Luis Miguel Delgado Gomez
Estaré ausente de la oficina desde el 22/05/2009 y no volveré hasta el 04/06/2009. Responderé a su mensaje cuando regrese. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] optimizing function over x,y

2009-05-23 Thread Ravi Varadhan
Look at nlminb() or optim(), in particular the option `method = L-BFGS-B' or the function spg() in BB package. With these you can optimize over any number of variables. Ravi. Ravi Varadhan, Ph.D. Assistant Professor,

[R] create vectors within a double loop

2009-05-23 Thread Nikos Alexandris
Hi R-list. This is my first post. I'll try to be as precise as possible with the difficulty I have to get things done. I have a hard time trying to construct a double for loop and create within the inner loop new objects (in this case vectors). I posted this question in a non-directly related

[R] dimnames does not match array extent

2009-05-23 Thread Penner, Johannes
Dear R help-list, I am trying to calculate Monmoniers algorithm. I have 3 data sets: coordinates (coord), distance matrix (comdist) and geographical distance matrix (geodist). I consistently get the error dimnames does not match array extent. However, when I use the function structure I get

Re: [R] Draw a rectangle on top of an image using RGtk2?

2009-05-23 Thread Ronggui Huang
Thanks, Michael. Just one more follow-up question. Is there other way to get the GdkDrawable (here da2) without using - or other assignment operation from within expose_fn? I thought da$GetRootWindow() would work, but it does not. da - gtkDrawingArea() da2 - NULL expose_fn -

Re: [R] build CONTENTS or 00Index.html without installing whole package

2009-05-23 Thread Jonathan Baron
Replying to myself again, I've now figured out how to build all the help files, including 00Index.html, without actually building the package. The point is to construct a complete list of all html help files for searching. The one thing I cannot figure out is how to build the index of all

[R] Save values from an expression that is created from deriv command

2009-05-23 Thread dimitris kapetanakis
Dear all, I want to save a value from an expression that I created by using the deriv function. So for example the output from an expression using the deriv command is: expression({ .expr7 - 4 * b.nox.2^2 - 12 * b.nox.3 * b.nox.1 .expr9 - -2 * b.nox.2 - sqrt(.expr7) .expr10 - 6 *

Re: [R] Save values from an expression that is created from deriv command

2009-05-23 Thread Gabor Grothendieck
Try this: D(expression(x*x), x) On Sat, May 23, 2009 at 12:46 PM, dimitris kapetanakis gami...@gmail.com wrote: Dear all, I want to save a value from an expression that I created by using the deriv function. So for example the output from an expression using the deriv command is:

[R] Search for longest consecutive occurrence

2009-05-23 Thread tsunhin wong
Dear R Users, I am trying to write a script to count the longest consecutive occurring 1 in a sequence: test-c(1,1,1,1,1,1,1,0,0,0,0,1,1,0,1,0,1,0,1,1) In the case of the object test, 1 occurs 7 consecutive times which is the longest consecutive within the sequence. I know I can always do a

Re: [R] Search for longest consecutive occurrence

2009-05-23 Thread Gabor Grothendieck
Try this: with(rle(test), max(lengths[!!values])) On Sat, May 23, 2009 at 1:09 PM, tsunhin wong thjw...@gmail.com wrote: Dear R Users, I am trying to write a script to count the longest consecutive occurring 1 in a sequence: test-c(1,1,1,1,1,1,1,0,0,0,0,1,1,0,1,0,1,0,1,1) In the case of

Re: [R] Search for longest consecutive occurrence

2009-05-23 Thread tsunhin wong
Thanks! I tested it using: test-c(1,1,1,1,1,0,0,0,0,0,0,0,1,1,0,1,0,1,0,1,1) that has a longer 7 zeros and 5 ones. What part of the script does the selection of ones instead of zeros? - John On Sat, May 23, 2009 at 1:17 PM, Gabor Grothendieck ggrothendi...@gmail.com wrote: Try this:

Re: [R] Search for longest consecutive occurrence

2009-05-23 Thread Gabor Grothendieck
!! On Sat, May 23, 2009 at 1:52 PM, tsunhin wong thjw...@gmail.com wrote: Thanks! I tested it using: test-c(1,1,1,1,1,0,0,0,0,0,0,0,1,1,0,1,0,1,0,1,1) that has a longer 7 zeros and 5 ones. What part of the script does the selection of ones instead of zeros? - John On Sat, May 23, 2009

Re: [R] Search for longest consecutive occurrence

2009-05-23 Thread tsunhin wong
Thanks for introducing me to with and the smart use of R subscripting Now I know I can do something like this. test-c(1,1,1,1,1,0,0,0,0,0,2,2,2,2,2,2,0,1,0,1,1,0,0,0,0,0,0,0) with(rle(test), max(lengths[values==2])) [1] 6 with(rle(test), max(lengths[values==1])) [1] 5 with(rle(test),

Re: [R] create vectors within a double loop

2009-05-23 Thread jim holtman
You might want to look at how to use 'lapply' to create lists. Here is one way of doing it: # create test data a_threshold - b_threshold - as.data.frame(matrix(sample(c(1:5, NA), 100, TRUE), 10)) classification - c('a', 'b') result - lapply(classification, function(.cls){ +

Re: [R] Clean up a complex variable

2009-05-23 Thread jim holtman
Here is one way of solving it: x - c('0(a=1)' ,'0(b=1)' ,'0.133(b=1)' ,'0.555(a=1)' ,'5.32(a=1)') # ( and ) have special meaning in regular expressions so they have to be escaped (y - as.numeric(gsub(\\(.*\\ file://(.*//)|, , x))) [1] 0.000 0.000 0.133 0.555 5.320 # find a=1 to divide

Re: [R] how to insert NULLs in lists?

2009-05-23 Thread Kynn Jones
On Fri, May 22, 2009 at 7:32 PM, markle...@verizon.net wrote: Hi Kynn: this oddity is discussed in Patrick Burn's document called The R Inferno. I don't recall the fix so I'm not sure if below is the same as what his book says to do but it seems to do what you want. Wow, I sure hit the

[R] getting % influence for 2 factors in LDA

2009-05-23 Thread Pete Shepard
Hello R-list, I am preforming an lda on the following data. Curvature Diameter Quality 1 2.95 6.63Passed 2 2.53 7.79Passed 3 3.57 5.65Passed 4 3.16 5.47Passed 5 2.58 4.46 NotPassed 6 2.16 6.22 NotPassed 7 3.27

Re: [R] Naming a random effect in lmer

2009-05-23 Thread Leigh Ann Starcevich
I am having trouble modifying the lmer code to make the change that William Dunlap suggested, and I believe that this is because the environment is locked. I tried: 1. Revising the lmerFactorList function in a word processor and copying/pasting into lmer, but this did not work because the

[R] Cream Text Editor

2009-05-23 Thread Paul Heinrich Dietrich
I'm interested in easing my way into learning VIM by first using the Cream text editor, liking the idea that it will work on both my Linux and Windows computers. I've installed Cream on my Linux machine, but can't figure out how to make Cream talk to R? Does anybody know? I'm using Ubuntu if

Re: [R] create vectors within a double loop

2009-05-23 Thread Nikos Alexandris
jim holtman: You might want to look at how to use 'lapply' to create lists. Here is one way of doing it: # create test data a_threshold - b_threshold - as.data.frame(matrix(sample(c(1:5, NA), 100, TRUE), 10)) classification - c('a', 'b') result - lapply(classification,

Re: [R] Cream Text Editor

2009-05-23 Thread JiHO
On 2009-May-23 , at 17:40 , Paul Heinrich Dietrich wrote: I'm interested in easing my way into learning VIM by first using the Cream text editor, liking the idea that it will work on both my Linux and Windows computers. I've installed Cream on my Linux machine, but can't figure out how

Re: [R] Cream Text Editor

2009-05-23 Thread Jakson Alves de Aquino
As pointed by JiHO the biggest disadvantage of using the plugin is that R is running through a pipe and consequently it is less interactive. Just a note: there is no need of Esc before F9. Almost all key bindings work in insert, normal and visual modes. The last version of the plugin allows the

[R] using optimize() correctly ...

2009-05-23 Thread Esmail
Hi, I am trying to use the optimize function to optimize a function. The results I am getting don't agree with what I compute on my own and when I look at the graph of f(x) = 100 + ((x-10)**2 + (x-10)) * cos(x-10), where -10 = x = 10 in gnuplot. I suspect I am making a mistake in the

Re: [R] optimizing function over x,y

2009-05-23 Thread Esmail
Ravi Varadhan wrote: Look at nlminb() or optim(), in particular the option `method = L-BFGS-B' or the function spg() in BB package. With these you can optimize over any number of variables. Ravi. Hi Ravi, Thanks for the leads, I'll take a look, though right now I have run into problems

Re: [R] rank reduction method in time series analysis?

2009-05-23 Thread spencerg
Hello: Have you looked at Pfaff (2008) Analysis of Integrated and Cointegrated Time Series with R, 2nd ed. (Springer)? I have not read this book, but the title and table of contents sounds like it contains many alternative answers to your question, with the best among those

Re: [R] Cream Text Editor

2009-05-23 Thread JiHO
On 2009-May-23 , at 20:16 , Jakson Alves de Aquino wrote: Just a note: there is no need of Esc before F9. Almost all key bindings work in insert, normal and visual modes. Well, without switching to the non-insert mode, I find that pressing F9 prints the commands in the file instead of

Re: [R] using optimize() correctly ...

2009-05-23 Thread Berend Hasselman
Esmail Bonakdarian-4 wrote: Hi, I am trying to use the optimize function to optimize a function. The results I am getting don't agree with what I compute on my own and when I look at the graph of f(x) = 100 + ((x-10)**2 + (x-10)) * cos(x-10), where -10 = x = 10 in gnuplot.