Re: [R] array searches

2007-02-23 Thread Murali Menon
Hi, This is truly amazing stuff. Inspired by Jim's and Olivier's suggestions, I'm trying to expand it to work with a m x n matrix, where the first column is dates and the next columns are all signals. I dare say a suitable application of 'apply' should work. Thanks a ton. Murali From: jim

[R] help with RMySQL

2007-02-23 Thread Ravi S. Shankar
Hi R users, I am using RMySQL to connect to a database in MySQL. I have 3 questions. 1)When I give the following command dbListTables(con) I get the output stack imbalance in .Call, 142 then 143 stack imbalance in -, 140 then 141 stack imbalance in {, 138 then 139 stack

Re: [R] Wrinting integers in a matrix faile

2007-02-23 Thread Oleg Sklyar
write.matrix(as.integer(b),'data.out') Mohsen Jafarikia wrote: Hello everyone, I am using the following program to get the p-value of some numbers (column 'LR' of the data.dat file). I want to write the 1st and 2nd column of the output file (data.out) as an integer while the program change

[R] kernel regression

2007-02-23 Thread Romain . Mayor
Dear R community, I have tried to use the kernel regression in the NP package. I work in a population biology study and the regression function (npr) dealing with continuous and categorical variables seems to be appropriate for such study with non parametric data. I have 3 questions: First: Is

[R] optim(method=L-BFGS-B) abnormal termination

2007-02-23 Thread Petr Klasterecky
Hi, my call of optim() with the L-BFGS-B method ended with the following error message: ERROR: ABNORMAL_TERMINATION_IN_LNSRCH Further tracing shows: Line search cannot locate an adequate point after 20 function and gradient evaluations final value 0.086627 stopped after 7 iterations Could

Re: [R] question about boxplot

2007-02-23 Thread Stephen Tucker
You can also set axes=FALSE as in boxplot( p.prop ~ R + bins, axes=FALSE ) and then add your own labels with axis(). the argument 'at' for axis() in the case of boxplots are usually integers going from 1 to # of groups, though I don't know specifically for your crossed factors. For rotated

Re: [R] mixture of 2 normals - starting values

2007-02-23 Thread Tatiana Benaglia
Hi, you can also look at the function normalmix.init in the mixtools package. Tatiana Tatiana Benaglia Ph.D. Candidate Department of Statistics Penn State University On Feb 23, 2007, at 12:02 AM, [EMAIL PROTECTED] wrote: Hi, I have a problem of estimating a mixture of two normal

Re: [R] how much performance penalty does this incur, scalar as a vector of one element?

2007-02-23 Thread Jeffrey J. Hallman
The 64 bit version of VisualWorks Smalltalk has an immediate ShortDouble, which sacrifices two bits of exponent for a tag. It thus has the same precision as an IEEE double, but one fourth as much range. Overflows automatically get promoted to ordinary Double's, which are pointers to objects

[R] TRUE/FALSE as numeric values

2007-02-23 Thread Thomas Preuth
Hello, I want to select in a column of a dataframe all numbers smaller than a value x but when I type in test-(RSF_EU$AREA=x) I receiv as answer: test [1] TRUE FALSE FALSE TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE TRUE [18] TRUE TRUE TRUE TRUE FALSE

Re: [R] TRUE/FALSE as numeric values

2007-02-23 Thread Ranjan Maitra
On Fri, 23 Feb 2007 14:38:56 +0100 Thomas Preuth [EMAIL PROTECTED] wrote: Hello, I want to select in a column of a dataframe all numbers smaller than a value x but when I type in test-(RSF_EU$AREA=x) I receiv as answer: test [1] TRUE FALSE FALSE TRUE TRUE TRUE FALSE FALSE TRUE

Re: [R] TRUE/FALSE as numeric values

2007-02-23 Thread Henrique Dallazuanna
You can also: test - RSF_EU[which(RSF_EU$AREA=x),] On 23/02/07, Thomas Preuth [EMAIL PROTECTED] wrote: Hello, I want to select in a column of a dataframe all numbers smaller than a value x but when I type in test-(RSF_EU$AREA=x) I receiv as answer: test [1] TRUE FALSE FALSE TRUE TRUE

Re: [R] TRUE/FALSE as numeric values

2007-02-23 Thread ONKELINX, Thierry
RSF_EU$AREA[RSF_EU$AREA=x] ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Reseach Institute for Nature and Forest Cel biometrie, methodologie en kwaliteitszorg / Section biometrics, methodology and

Re: [R] TRUE/FALSE as numeric values

2007-02-23 Thread Gavin Simpson
On Fri, 2007-02-23 at 14:38 +0100, Thomas Preuth wrote: Hello, I want to select in a column of a dataframe all numbers smaller than a value x but when I type in test-(RSF_EU$AREA=x) I receiv as answer: test [1] TRUE FALSE FALSE TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE FALSE

[R] Question concerning survival analysis

2007-02-23 Thread Rainer M. Krug
Hi I have a data set consisting of pictures on which individual plants were identified and categorized into alive, dead and unknown if it was not clear. The time of these pictures ranges from 1937 to today and the intervals range between 13 and 1 year. I am trying to get an understanding of the

[R] controling axes on boxplot() thanks to ST, JvdH, MK

2007-02-23 Thread Smith, Phil \(CDC/CCID/NCIRD\)
Hi R-ers: I asked a question about how to control the axes on boxplot. Here is what worked: namz - c( R=1/Q1 , R=0/Q1 , R=1/Q2 , R=0/Q2 , R=1/Q3 , R=0/Q3 , R=1/Q4 , R=0/Q4 ) boxplot( p.prop ~ R + bins , boxwex= .5 , plot = TRUE , axes = FALSE ) axis( side = 1 , at=c(1:8) , labels = namz

[R] How to plot two graphs on one single plot?

2007-02-23 Thread Yun Zhang
Hi, I am trying to plot two distribution graph on one plot. But I dont know how. I set them to the same x, y limit, even same x, y labels. Code: x1=rnorm(25, mean=0, sd=1) y1=dnorm(x1, mean=0, sd=1) x2=rnorm(25, mean=0, sd=1) y2=dnorm(x2, mean=0, sd=1) plot(x1, y1, type='p',

[R] R Mailing list in Cape Town - South Africa

2007-02-23 Thread Rainer M. Krug
Hi I hope that I don't break any rules - I just want to announce that we started a mailing list for R in Cape Town. The address is: https://cbio.uct.ac.za/mailman/listinfo/sabior The basic idea of the mailing list is to bring R users in the region around Cape Town and in South Africa closer

Re: [R] How to plot two graphs on one single plot?

2007-02-23 Thread Henrique Dallazuanna
par(mfrow=c(2,1)) #your plot #after plot par(mfrow=c(1,1)) On 23/02/07, Yun Zhang [EMAIL PROTECTED] wrote: Hi, I am trying to plot two distribution graph on one plot. But I dont know how. I set them to the same x, y limit, even same x, y labels. Code: x1=rnorm(25, mean=0, sd=1)

[R] Google Custom Search Engine for R

2007-02-23 Thread Sérgio Nunes
Hi, Since R is a (very) generic name, I've been having some trouble searching the web for this topic. Due to this, I've just created a Google Custom Search Engine that includes several of the most relevant sites that have information on R. See it in action at:

Re: [R] how much performance penalty does this incur, scalar as a vector of one element?

2007-02-23 Thread Luke Tierney
Thanks -- that's good to know. Best, luke On Fri, 23 Feb 2007, Jeffrey J. Hallman wrote: The 64 bit version of VisualWorks Smalltalk has an immediate ShortDouble, which sacrifices two bits of exponent for a tag. It thus has the same precision as an IEEE double, but one fourth as much

Re: [R] How to plot two graphs on one single plot?

2007-02-23 Thread Yun Zhang
Thanks. Now R plots two graphs on one plot. Yet they are still on two graphs, vertically parallelized with each other. But what I want to do is actually plotting two distribution on one single graph, using the same x and y axis. Like: | | | (dist2) | (dist 1) |

Re: [R] How to plot two graphs on one single plot?

2007-02-23 Thread Henrique Dallazuanna
Hum, ok, i don't was understanding, you can try: plot(x1, y1, type='p', xlim=range(x1,x2), ylim=range(y1, y2), xlab='x', ylab='y') lines(x2, d2, type='p', col='red') Or perhaps ?curve On 23/02/07, Yun Zhang [EMAIL PROTECTED] wrote: Thanks. Now R plots two graphs on one plot. Yet they are

Re: [R] How to plot two graphs on one single plot?

2007-02-23 Thread Matthew Keller
Hi Yun, If you're asking how to place new graphic material on the same plot (e.g., several lines/points/etc in a single x-y region), this is covered in the Intro to R manual. E.g., you can do: plot(x1, y1, type='p', xlim=range(x1,x2), ylim=range(y1, y2), xlab='x', ylab='y') points(x2, y2,

Re: [R] How to plot two graphs on one single plot?

2007-02-23 Thread Clint Bowman
?par try par(new=TRUE) between plots Clint BowmanINTERNET: [EMAIL PROTECTED] Air Dispersion Modeler INTERNET: [EMAIL PROTECTED] Air Quality Program VOICE: (360) 407-6815 Department of Ecology FAX:(360) 407-7534

Re: [R] Google Custom Search Engine for R

2007-02-23 Thread Matthew Keller
Hi Sergio, There was a discussion on this board recently about the difficulty of searching for R related material on the web. I think the custom google search engine is a good idea. It would be helpful if we could have access to the full list of websites it is indexing so that we could make

[R] Repeated measures in Classification and Regresssion Trees

2007-02-23 Thread Andrew Park
Dear R members, I have been trying to find out whether one can use multivariate regression trees (for example mvpart) to analyze repeated measures data. As a non-parametric technique, CART is insensitive to most of the assumptions of parametric regression, but repeated measures data raises the

Re: [R] How to plot two graphs on one single plot?

2007-02-23 Thread Yun Zhang
Thanks, it works. Thank you very much. Yun Matthew Keller wrote: Hi Yun, If you're asking how to place new graphic material on the same plot (e.g., several lines/points/etc in a single x-y region), this is covered in the Intro to R manual. E.g., you can do: plot(x1, y1, type='p',

[R] Neural Net forecasting

2007-02-23 Thread sj
Are there any packages in R that are suitable for doing time series forecasting using neural networks? I have looked in the nnet package and neural package and they both seem geared towards classification. thanks, Spencer [[alternative HTML version deleted]]

Re: [R] Google Custom Search Engine for R

2007-02-23 Thread Sérgio Nunes
Hi, I've just created this search engine for testing today. I think that if you volunteer as a contributor (see link on the left side) you can then see and add to the list of sites. I've also noticed that I can add sites by importing a XML file. Is there any list of sites that could be easily

Re: [R] Neural Net forecasting

2007-02-23 Thread Carlos Ortega
Hello, Yes, time ago Luis Torgo posted a link to his web site where you can find his book which covers with an example what you are looking for. The link is this: http://www.liacc.up.pt/~ltorgo/DataMiningWithR/ Regards, Carlos Ortega. On 2/23/07, sj [EMAIL PROTECTED] wrote: Are there any

Re: [R] Google Custom Search Engine for R

2007-02-23 Thread Sérgio Nunes
I just seen the link you suggested - RSeek - and it uses exactly the same service from Google. The only difference is that it is not open to new contributions. Maybe Sasha could open it to volunteers. Also it seems to be much more complete than my initial attempt (as expected :). I think that

Re: [R] Repeated measures in Classification and Regresssion Trees

2007-02-23 Thread Bert Gunter
Andrew: Good question! AFAIK most of the so-called machine learning machinery -- regression and classification trees, SVM's, neural nets, random forests, and other more chic methods (I make no attempt to keep up with all of them) -- ignore error structure; that is, they assume the data are at

Re: [R] Neural Net forecasting

2007-02-23 Thread Antonio, Fabio Di Narzo
The tsDyn package has the 'nnetTs' model, for fitting univariate NNET time series model. The model is presented as a NonLinearAutoRegressive model. Boundled with tsDyn there is a vignette with some working examples. Hope this helps. Bests, Antonio. 2007/2/23, sj [EMAIL PROTECTED]: Are there any

Re: [R] Google Custom Search Engine for R

2007-02-23 Thread michael watson \(IAH-C\)
I always just google for the terms I want and then add R-help to the search, which limits it to the R-help mailing list. It's quite effective. From: [EMAIL PROTECTED] on behalf of Matthew Keller Sent: Fri 23/02/2007 3:51 PM To: Sérgio Nunes Cc:

[R] using integrate in a function definition

2007-02-23 Thread theo borm
Dear list members, I'm quite new to R, and though I tried to find the answer to my probably very basic question through the available resources (website, mailing list archives, docs, google), I've not found it. If I try to use the integrate function from within my own functions, my functions

Re: [R] using integrate in a function definition

2007-02-23 Thread Ravi Varadhan
Your function jjj is not vectorized. Try this: jjj - function(www) sapply(www, function(x)2*integrate(dnorm,0,x)$value) plot(jjj, 0, 5) It should work. Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, The

Re: [R] Looking for info on R Advanced programming in the West Coast

2007-02-23 Thread elvis
Hi Tim, We'll be offering our R/S Advanced Programming course in San Franciscon on March 15-16. All the Best - Elvis Tim McDonald tim_b_mcdonald at yahoo.com writes: Hi folks, If you know of any upcoming R Advanced Programming in the West Coast - USA, please let me know.

Re: [R] Google Custom Search Engine for R

2007-02-23 Thread Sasha Goodman
Thanks for emailing. I've added volunteers on RSeek on a trial basis. There are several concerns, though: One big issue is quality. Allowing volunteers means that someone might need to police the volunteers, as they can put in advertisements for books, links to sites that try to hack your

Re: [R] TRUE/FALSE as numeric values

2007-02-23 Thread Prof Brian Ripley
It is inefficient to use which() rather than a logical index, since you allocate two numeric index vectors (one the length of the original vector) and use an interpreted function rather than optimized C code. Also, in this usage which() handles NAs incorrectly. I think the clearest answer is

Re: [R] optim(method=L-BFGS-B) abnormal termination

2007-02-23 Thread Tony Plate
I usually see this message only when my gradient and objective functions do not match each other. I debug by comparing a finite difference approximation to the gradient with the result of the gradient function. I think you can also run optim() without supplying a gr() function - optim()

Re: [R] using integrate in a function definition

2007-02-23 Thread Alberto Monteiro
theo borm wrote: jjj-function(www) {2*integrate(dnorm,0,www)$value} kkk-function(www) {2*(pnorm(www)-0.5)} xxx-seq(0:5) yyy-jjj(xxx) zzz-kkk(xxx) produces no errors, but: yyy [1] 0.6826895 zzz [1] 0.6826895 0.9544997 0.9973002 0.367 0.994 1.000 Why is this?

[R] some caracter dont work with JGR

2007-02-23 Thread Ronaldo Reis Junior
Hi, I testing JGR and I like, but my ~ caracter dont work. My keyboard is Brazilian ABNT2. The key is OK, only in JGR it dont work. Anybody have any idea about this? Thanks Ronaldo -- Mais variado que baldeação em Cacequi. -- Prof. Ronaldo Reis Júnior | .''`. UNIMONTES/Depto. Biologia

[R] pdf with an exact size

2007-02-23 Thread Alberto Monteiro
Is it possible to create a pdf output file with an (as nearly as possible) exact size? For example, if I want to draw in an A4 paper (210 x 297 mm) a square of 100 x 100 mm, how can I do it? FWIW, about 6 months ago I learned here how to create an exact png image. For example, if I want a 500 x

Re: [R] pdf with an exact size

2007-02-23 Thread Alberto Monteiro
I must be stupid and/or crazy... I figured out the solution a few minutes after I asked :-/ Is it possible to create a pdf output file with an (as nearly as possible) exact size? Yes: pdf(a4.pdf, width=210, height=297, bg=white, paper=a4) par(mar=c(0,0,0,0)) # reset margins plot(0,

Re: [R] problem with weights on lmer function

2007-02-23 Thread Ronaldo Reis Junior
Em Quinta 22 Fevereiro 2007 20:36, Andrew Robinson escreveu: Hi Ronaldo, I suggest that you send us a small, well-documented, code example that we can reproduce. It certainly looks as though there is a problem, but given this information it's hard to know what it is! Cheers Andrew

[R] how to use apply with two variables

2007-02-23 Thread Serguei Kaniovski
Hi, this is a made-up example. Function myfun returns two arguments. Can apply be used so that myfun is called only once? Thanks Serguei mat-matrix(runif(50),nrow=10,ncol=5) myfun-function(x) { mymean-mean(x) mysd-sd(x) return(mymean,mysd) } out1-t(apply(mat,1,function(x)

Re: [R] how to use apply with two variables

2007-02-23 Thread Liaw, Andy
Yes. Just try it and see. BTW, your usage of return() is not recommended anymore. This is probably easier: myfun-function(x) c(mean=mean(x), sd=sd(x)) out - apply(mat, 1, myfun) ## or... out2 - cbind(mean=rowMeans(mat), sd=sd(t(mat))) Andy From: Serguei Kaniovski Hi, this is a

Re: [R] mixture of 2 normals - starting values

2007-02-23 Thread Earl F. Glynn
If you don't have too much noise, the peaks in the derivative curves can be used: See: http://research.stowers-institute.org/efg/R/Statistics/MixturesOfDistributions/index.htm efg Earl F. Glynn Scientific Programmer Stowers Institute for Medical Research [EMAIL PROTECTED] wrote in message

Re: [R] Overlaying graphics

2007-02-23 Thread Takatsugu Kobayashi
Rusers: This is a very fundamental and silly question. How can I overlay different maps on the same x and y scales? I do neither want to change X and Y axes nor show different x and y ticks on top of each other. Thanks Taka Indiana University __

Re: [R] using integrate in a function definition

2007-02-23 Thread theo borm
Ravi Varadhan wrote: Your function jjj is not vectorized. Try this: jjj - function(www) sapply(www, function(x)2*integrate(dnorm,0,x)$value) plot(jjj, 0, 5) It should work. Yes it does. Thanks! Thinking of it, it now starts to make some sort of sense that integrate should return a

Re: [R] Google Custom Search Engine for R

2007-02-23 Thread Steven McKinney
Whereas R is very generic, CRAN is much less so. I've had very good luck adding CRAN to my search terms, e.g. try to Google cran 3d scatterplot This produces all R-related hits on the first Google page. Hope this helps Steven McKinney Statistician Molecular Oncology and Breast Cancer

Re: [R] using integrate in a function definition

2007-02-23 Thread theo borm
Hi, Many thanks for the explanation. Alberto Monteiro wrote: PS: fff - function(x) 1 integrate(fff, 0, 1) # error. why? Guess: because integrate itself expects a vectorized function ? fff(1:5) [1] 1 ggg-function(x) { sapply(x, function(x)1) } ggg(1:5) [1] 1 1 1 1 1

Re: [R] pdf with an exact size

2007-02-23 Thread Joerg van den Hoff
On Fri, Feb 23, 2007 at 04:24:54PM -0200, Alberto Monteiro wrote: Is it possible to create a pdf output file with an (as nearly as possible) exact size? For example, if I want to draw in an A4 paper (210 x 297 mm) a square of 100 x 100 mm, how can I do it? FWIW, about 6 months ago I

Re: [R] How to plot two graphs on one single plot?

2007-02-23 Thread Steven McKinney
Broadly speaking, there are a few classes of plotting functions. 1) New graph functions. The plot() function starts a new graph. 2) Add to a graph functions The points(), lines(), text() etc. functions add something to the current graph. 3) Control graph functions par() controls various