Re: [R] simulating Gaussian Mixture Method

2008-06-16 Thread Moshe Olshansky
You should not add the 3 six dimensional variables!!! By adding them you are getting a multivariate normal variable and not a mixture! To get a mixture with probabilities p1 for the first, p2 for the second and p3 for the third one (p1+p2+p3=1), simulate a [0,1] uniform variable X and return

Re: [R] simulating Gaussian Mixture Method

2008-06-16 Thread Bill.Venables
Adding them together will not give you a sample from a mixture, it gives you a sample from another multivariate normal distribution. Rather than add them together what you have to do is select from each of the two samples with the appropriate probability. e.g. suppose your mixing probability

[R] Superimposing Line over Histogram in Density Plot

2008-06-16 Thread Gundala Viswanath
Hi, Currently I have a density plot generated with this snippet. Is there a way I can add a line curve on top of it? I mean in one figure __BEGIN__ myhist - hist(x col=blue, main = Density Plot, xlab = Exp Level, ) __END__ - Gundala

Re: [R] package under unix

2008-06-16 Thread Prof Brian Ripley
If you want a new device opened you can call dev.new() In current R. X11() does have xpos and ypos, *but* there is no guarantee that any value you choose will not be the same as the default. Indeed, with windows(5,5,xpos=0) you will put your second window on top of the first one in my setup.

[R] Display a jpeg inside a widget which already has text

2008-06-16 Thread danzam
Hi I am trying to insert a jpeg into a widget I have created. I have used this link http://bioinf.wehi.edu.au/~wettenhall/RTclTkExamples/showImage.html to display a jpeg inside a newly created widget but would like some info on how to insert into a pre existing widget. This is my code below

[R] error in dat

2008-06-16 Thread Paul Adams
Hello everyone, I have the following code which keeps giving me an error. The code is: dat-read.table(file=C:\\Documents and Settings\\Owner\\My Documents\\eisen.txt,header=T,row.names=1,blank.lines.skip=F,na..strings=NA) dimnames(dat)((1)) -as.character(dat(,1)) dat-dat(,-1)

Re: [R] randomForest, 'No forest component...' error while calling Predict()

2008-06-16 Thread Jim_S
Now I read it in the manual If xtest is given, defaults to FALSE. Thanks for your help! Jim Moshe Olshansky-2 wrote: You must use randomForest with keep.forest=TRUE - otherwise the Forest object is not saved and so no prediction can be made. --- On Mon, 16/6/08, Jim_S [EMAIL

Re: [R] Superimposing Line over Histogram in Density Plot

2008-06-16 Thread Dimitris Rizopoulos
try something like this: x - rnorm(200) hist(x, col = blue, freq = FALSE) lines(density(x), col = red, lwd = 2) I hope it helps. Best, Dimitris Dimitris Rizopoulos Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium

Re: [R] package under unix

2008-06-16 Thread cgenolin
Hi I entirely agree with Patrick, and would add 'why do you think a 5 square window is appropriate on both 8 and 30 monitors?'. I do not realy care about 5, 8 or 20, I use it when I devellop, I will remove it for the final package. I just want the two windows to not be one on the top of the

Re: [R] package under unix

2008-06-16 Thread Prof Brian Ripley
X11() is the standard Unix device: see your subject line. Testing x11() under Windows isn't relevant to your subject line (which in any case is not helpful -- the posting guide asks you to use informative subject lines). There is no 'R 2.7', and you are explicitly asked in the posting guide

Re: [R] error in dat

2008-06-16 Thread Wacek Kusnierczyk
Paul Adams wrote: Hello everyone, I have the following code which keeps giving me an error. The code is: dat-read.table(file=C:\\Documents and Settings\\Owner\\My Documents\\eisen.txt,header=T,row.names=1,blank.lines.skip=F,na..strings=NA) dimnames(dat)((1)) -as.character(dat(,1))

Re: [R] error in dat

2008-06-16 Thread Prof Brian Ripley
On Mon, 16 Jun 2008, Wacek Kusnierczyk wrote: Paul Adams wrote: Hello everyone, I have the following code which keeps giving me an error. The code is: dat-read.table(file=C:\\Documents and Settings\\Owner\\My Documents\\eisen.txt,header=T,row.names=1,blank.lines.skip=F,na..strings=NA)

[R] How can I stop strwrap removing escape characters? (and solution to the screen wrapping question from 11/6)

2008-06-16 Thread Toby Marthews
After the helpful reply from Greg Snow (below), I've written a function printtoscreen which does the screen wrapping I need (although not in a very elegant way). This works fine for strings without any escape characters in them, e.g. printtoscreen=function(str) { +

[R] NLME: Prediction intervals for random effects

2008-06-16 Thread Marc Bernard
Dear all, nbsp; Is there a function to calculate thenbsp; prediction intervals for random effects in non-linear mixed models? I found a way to do it for linear mixed models but not for non-linearnbsp;mixed one. nbsp; Many thnaks nbsp; Bernard nbsp; nbsp;

Re: [R] How can I stop strwrap removing escape characters? (and solution to the screen wrapping question from 11/6)

2008-06-16 Thread Gavin Simpson
On Mon, 2008-06-16 at 11:33 +0200, Toby Marthews wrote: After the helpful reply from Greg Snow (below), I've written a function printtoscreen which does the screen wrapping I need (although not in a very elegant way). This works fine for strings without any escape characters in them, e.g.

Re: [R] How can I stop strwrap removing escape characters? (and solution to the screen wrapping question from 11/6)

2008-06-16 Thread Prof Brian Ripley
I think by 'escape characters' you mean 'whitespace characters'. There are no 'escape characters' in your string -- the escape character is \, and \n and \t are converted by the parser to characters when the string is constructed and so are not escapted in the string. ?strwrap explicitly

[R] ggplot2: How to remove legend component for geom_errorbar() ?

2008-06-16 Thread Carsten Jaeger
Dear list (probably Hadley), I'm trying to do a plot like the following, composed of bars and error bars: df - data.frame(factor1=gl(2,5), factor2=gl(5,1), y=rnorm(10), err=0.1) ggplot(df, aes(x=factor1, y=y, fill=factor2)) + geom_bar(position=dodge, stat=identity) +

[R] unique-fy colume names

2008-06-16 Thread Daren Tan
I have a column containing duplicate entries and need to append numeric suffixes to make them unique. How ? e.g., paste(id, c(1:10,1,5,10,10), sep=.) [1] id.1 id.2 id.3 id.4 id.5 id.6 id.7 id.8 id.9[10] id.10 id.1 id.5 id.10 id.10 I hope to get [1] id.1 id.2 id.3 id.4 id.5

[R] R on an ASUS eee PC, continued - installing packages

2008-06-16 Thread Millo Giovanni
Dear all, I just went through the process of installing R on an eeePC 900 running Linux. As a Windows useR utterly ignorant about Linux, I'd never have done it without reading your posts and the R Wiki, so first of all: thank you! Next, taking up your thread from some weeks ago, I thought this

Re: [R] package under unix

2008-06-16 Thread Patrick Connolly
On Mon, 16-Jun-2008 at 09:43AM +0200, [EMAIL PROTECTED] wrote: I do not realy care about 5, 8 or 20, I use it when I devellop, I will remove it for the final package. I just want the two windows to not be one on the top of the other. I do not care if one in on right, the other left, or one

Re: [R] R on an ASUS eee PC, continued - installing packages

2008-06-16 Thread Peter Dalgaard
Millo Giovanni wrote: The only thing I wish I were able to do now is to have the graphics windows defaults changed to a size fitting the small 9'' screen, as now I have to reduce it and move it to the right by hand every time to reproduce the results of 'windowstile in Windows. If anybody can

Re: [R] unique-fy colume names

2008-06-16 Thread Prof Brian Ripley
See ?make.unique On Mon, 16 Jun 2008, Daren Tan wrote: I have a column containing duplicate entries and need to append numeric suffixes to make them unique. How ? e.g., paste(id, c(1:10,1,5,10,10), sep=.) [1] id.1 id.2 id.3 id.4 id.5 id.6 id.7 id.8 id.9[10] id.10 id.1 id.5 id.10

Re: [R] R on an ASUS eee PC, continued - installing packages

2008-06-16 Thread Tom La Bone
I am running R in the konsole of the Kate editor on an eeePC 900 (standard Xandros OS). When a plot is generated it is initially too large to fit in the screen, but if I click on the plot it automatically resizes to fit properly. I have no idea if this is a default behavior. Tom Millo

Re: [R] R on an ASUS eee PC, continued - installing packages

2008-06-16 Thread Prof Brian Ripley
On Mon, 16 Jun 2008, Peter Dalgaard wrote: Millo Giovanni wrote: The only thing I wish I were able to do now is to have the graphics windows defaults changed to a size fitting the small 9'' screen, as now I have to reduce it and move it to the right by hand every time to reproduce the results

Re: [R] package under unix

2008-06-16 Thread cgenolin
x11(xpos = 1) # makes one on the left x11(xpos = -1) # makes one on the right Thanks you very much, I'll try that. Is there any difference between x11 and X11? Christophe Patrick Connolly [EMAIL PROTECTED] a écrit : On Mon, 16-Jun-2008 at 09:43AM +0200, [EMAIL PROTECTED] wrote: I do

[R] Very puzzled why swapping the columns doesn't swap the column names

2008-06-16 Thread Daren Tan
How can I swap the column names at the same time ? m - cbind(x=1:3, y=2:4, z=3:5) m x y z[1,] 1 2 3[2,] 2 3 4[3,] 3 4 5 m[,c(1,2)] - m[,c(2,1)] m x y z[1,] 2 1 3[2,] 3 2 4[3,] 4 3 5 _ [[alternative HTML version

Re: [R] Very puzzled why swapping the columns doesn't swap the column names

2008-06-16 Thread jim holtman
What you are doing with the assignment m[,c(1,2)] - m[,c(2,1)] is only changing the values in the matrix; it knows nothing about the names. If you want the names of the columns switched, then you have to do it: m - cbind(x=1:3, y=2:4, z=3:5) m x y z [1,] 1 2 3 [2,] 2 3 4 [3,] 3 4 5

Re: [R] Very puzzled why swapping the columns doesn't swap the column names

2008-06-16 Thread Wacek Kusnierczyk
Daren Tan wrote: How can I swap the column names at the same time ? m - cbind(x=1:3, y=2:4, z=3:5) m x y z[1,] 1 2 3[2,] 2 3 4[3,] 3 4 5 m[,c(1,2)] - m[,c(2,1)] m x y z[1,] 2 1 3[2,] 3 2 4[3,] 4 3 5 what you do here is to columns 1 and 2 put what is in columns 2 and 1,

Re: [R] R as chart engine in web-service

2008-06-16 Thread Daniel Cegielka
Can you put some criteria on 'better'/'faster'. What throughput are you expecting? How many requests per second will you have to handle? It's very difficult to tell how many request per second I will have to handle. If you have normal site it will be max. 2-5 tps (on chart website) but if

Re: [R] R on an ASUS eee PC, continued - installing packages

2008-06-16 Thread Peter Dalgaard
Prof Brian Ripley wrote: On Mon, 16 Jun 2008, Peter Dalgaard wrote: Millo Giovanni wrote: The only thing I wish I were able to do now is to have the graphics windows defaults changed to a size fitting the small 9'' screen, as now I have to reduce it and move it to the right by hand every

[R] sizing non-vector point shapes in ggplot2

2008-06-16 Thread mfrumin
Dear all, With normal plotting, one can size a set of points in a plot using a vector argument to cex in the points() function. This works whether you are using one of the standard R symbols (i.e. 19+) or some ascii symbol, such as '/' eg: plot(1:10, 1:10, type='n'); points(1:10, 1:10, cex =

[R] contrasts using adonis function

2008-06-16 Thread Luis San José García
Hi, Somebody knows how to make contrasts if i'm using the function adonis? Thanks. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and

Re: [R] R vs SAS and HLM on multilevel analysis- basic question

2008-06-16 Thread Douglas Bates
We may want to move this discussion to the R-SIG-Mixed-Models list, which I have cc:'d on this reply. On Sun, Jun 15, 2008 at 6:16 PM, eugen pircalabelu [EMAIL PROTECTED] wrote: Hi R users! I am trying to learn some multilevel analysis, but unfortunately i am now very confused. The reason:

[R] why does these warning mean?

2008-06-16 Thread Peng Jiang
Hi , I don't know whether it is a Mac specific problem. I hope it does not bother you. When I start R each time I got the following warning , I reinstall for many times the problem still exists. R(4053,0xa0619fa0) malloc: *** error for object 0x15630350: double free *** set a

Re: [R] Superimposing Line over Histogram in Density Plot

2008-06-16 Thread David Arnold
Look here: http://msenux.redwoods.edu/mathdept/R/CentralLimit.php D. On Jun 15, 2008, at 11:25 PM, Gundala Viswanath wrote: Hi, Currently I have a density plot generated with this snippet. Is there a way I can add a line curve on top of it? I mean in one figure __BEGIN__ myhist -

[R] R vs SAS and HLM on multilevel analysis- basic question

2008-06-16 Thread Ista Zahn
On Jun 16, 2008, at 6:00 AM, [EMAIL PROTECTED] wrote: From: eugen pircalabelu [EMAIL PROTECTED] Date: June 15, 2008 7:16:09 PM EDT To: R-help [EMAIL PROTECTED] Subject: [R] R vs SAS and HLM on multilevel analysis- basic question Hi R users! I am trying to learn some multilevel analysis,

Re: [R] contrasts using adonis function

2008-06-16 Thread Gavin Simpson
On Mon, 2008-06-16 at 14:38 +0200, Luis San José García wrote: Hi, Somebody knows how to make contrasts if i'm using the function adonis? What is wrong with the defaults? From ?adonis: Usage: adonis(formula, data, permutations = 5, method = bray, strata = NULL,

[R] Generating Reports from R.

2008-06-16 Thread David Keegan
Hi, I have a non-interactive R script that currently produces various graphs in png or pdf format. I need to program the script to combine the graphs with various pages of textual information, including some in tabular format, into an output report in pdf or html format. What is the recommended

Re: [R] Generating Reports from R.

2008-06-16 Thread Henrique Dallazuanna
Try using Sweave On Mon, Jun 16, 2008 at 10:37 AM, David Keegan [EMAIL PROTECTED] wrote: Hi, I have a non-interactive R script that currently produces various graphs in png or pdf format. I need to program the script to combine the graphs with various pages of textual information,

Re: [R] Delete Block of Rows

2008-06-16 Thread nmarti
Thanks for all the replies. My data frame is actually 4000 rows and 10 columns. This line, df - subset( df, !( rownames(df) %in% 1:25 ) ) Did not work for me. Is there a certain library I need to load for this to work (I'm assuming there isn't)? I didn't get an error message, warning, or

Re: [R] using spec.pgram

2008-06-16 Thread Anthony Mathelier
Perhaps I'm applying spec.pgram wrong as you said. I will explain what I want, so you can tell me why I'm wrong and perhaps what I have to do to do it well. I have some points in a 1-D space and I want to know if they are spaced at a certain periodic distance. So, I computed all the distances

[R] Error in maximum likelihood estimation.

2008-06-16 Thread Dong-hyun Oh
Dear UseRs, I wrote the following function to use MLE. - mlog - function(theta, nx = 1, nz = 1, dt){ beta - matrix(theta[1:(nx+1)], ncol = 1) delta - matrix(theta[(nx+2):(nx+nz+1)], ncol = 1) sigma2 - theta[nx+nz+2] gamma - theta[nx+nz+3] y

[R] Linear Regression ?

2008-06-16 Thread kayj
Hi All, I have a data with 15 columns. the first 10 column are dependent(y’s) variables and the following 5 an columns are the independent variables(x’s) ( MY DATA HAS A HEADER WITH THE NAME OF THE VAIABLES). I need to apply linear regression y=a+bx where I need x to be one of the independent

Re: [R] ggplot2: How to remove legend component for geom_errorbar() ?

2008-06-16 Thread hadley wickham
Hi Carsten, In my eagerness to get every component of the legend working automatically, I've completed neglected a way to turn bits off of you don't want them (the philosophy is that every geom that uses an aesthetic should appear in the legend in some way). The best thing I can suggest at the

Re: [R] Delete Block of Rows

2008-06-16 Thread milton ruser
Hi there, The subset function is available on your Base R. So you need not to load any package. May be it is not working because I suppose that your rownames is a sequential one (1...4000). Case it is not true, the command will not work. Anyway, I think that those line that are working find is

Re: [R] sizing non-vector point shapes in ggplot2

2008-06-16 Thread hadley wickham
On Mon, Jun 16, 2008 at 7:52 AM, mfrumin [EMAIL PROTECTED] wrote: Dear all, With normal plotting, one can size a set of points in a plot using a vector argument to cex in the points() function. This works whether you are using one of the standard R symbols (i.e. 19+) or some ascii symbol,

Re: [R] R on an ASUS eee PC, continued - installing packages

2008-06-16 Thread Prof Brian Ripley
On Mon, 16 Jun 2008, Peter Dalgaard wrote: Prof Brian Ripley wrote: On Mon, 16 Jun 2008, Peter Dalgaard wrote: Millo Giovanni wrote: The only thing I wish I were able to do now is to have the graphics windows defaults changed to a size fitting the small 9'' screen, as now I have to reduce

Re: [R] stretching text vertically

2008-06-16 Thread Greg Snow
You can embed plots using the subplot function in the TeachingDemos package. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alex

[R] aggregate() function, strange behavior for augmented data

2008-06-16 Thread David Afshartous
All, I'm re-running some analysis that has been augmented with additional data. When I use the exact same code for the augmented data, the behavior of the aggregate function is very strange, viz., one of the resulting variables is now coded as a factor while it was coded as numeric for the

Re: [R] Importing data with different delimters

2008-06-16 Thread Greg Snow
It looks like your original data may be tab seperated, if that is the case then just use read.delim or use sep='\t' in read.table or scan. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original Message- From:

Re: [R] using spec.pgram

2008-06-16 Thread stephen sefick
To get some sort of frequency which in your case seem to be cycles per distance? Is a valid use of a fourier transform as long as it is a distance that is measured in a way that would be analogous to a time series- In other words if the distance proceeds from an origin in one direction-

Re: [R] Importing data with different delimters

2008-06-16 Thread milton ruser
Hi David, If the delimier is tab try this. my.df-read.table(my_file.txt, head=T, sep=\t) Cheers, Miltinho Brazil -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Arnold Sent: Friday, June 13, 2008 5:15 PM To: r-help@r-project.org

Re: [R] Importing data with different delimters

2008-06-16 Thread Peter Dalgaard
Greg Snow wrote: It looks like your original data may be tab seperated, if that is the case then just use read.delim or use sep='\t' in read.table or scan. I think that was only half the problem. If you do that, you end up with one column containing both City and State, comma-separated.

Re: [R] aggregate() function, strange behavior for augmented data

2008-06-16 Thread David Afshartous
Everything was read in the same way, and str(junk1) confirms that they are the same structure. This is very strange. ## original data: str(junk1) 'data.frame': 96 obs. of 3 variables: $ Hour: int 0 3 5 0 3 5 0 3 5 0 ... $ Drug: Factor w/ 2 levels D,P: 2 2 2 1 1 1 2 2 2 1 ... $ Aldo: int

Re: [R] sizing non-vector point shapes in ggplot2

2008-06-16 Thread Michael Frumin
On Mon, Jun 16, 2008 at 3:55 PM, hadley wickham [EMAIL PROTECTED] wrote: On Mon, Jun 16, 2008 at 7:52 AM, mfrumin [EMAIL PROTECTED] wrote: Dear all, With normal plotting, one can size a set of points in a plot using a vector argument to cex in the points() function. This works

Re: [R] round(1.5) = round(2.5) = 2?

2008-06-16 Thread Greg Snow
The logic behind the round to even rule is that we are trying to represent an underlying continuous value and if x comes from a truly continuous distribution, then the probability that x==2.5 is 0 and the 2.5 was probably already rounded once from any values between 2.45 and

[R] optim() and starting values.

2008-06-16 Thread Dong-hyun Oh
Dear UseRs, I wrote the following function to estimate parameters using MLE. mlog - function(theta, nx = 1, nz = 1, dt){ beta - matrix(theta[1:(nx+1)], ncol = 1) delta - matrix(theta[(nx+2):(nx+nz+1)], ncol = 1) sigma2 - theta[nx+nz+2] gamma -

Re: [R] R as chart engine in web-service

2008-06-16 Thread jim holtman
I think that you have to define some type of criteria on what you expect the performance to be. There is a cost/benefit tradeoff in having multiple servers with a load balancer and this all depends on how much you want to spend on a solution. You might want to prototype it in R to at least get

Re: [R] ggplot2: How to remove legend component for geom_errorbar() ?

2008-06-16 Thread hadley wickham
thanks for your tip! It worked fine (though I had to use tile instead of point). I see your point to handle legends the way you do, which is a very convenient feature of ggplot. It's great for points, lines, bars etc., but in the particular case of error bars, I think it would be reasonable

[R] prediction intervals for random effects in nlme

2008-06-16 Thread Marc Bernard
Dear all, nbsp; This is a relist of my previous question. I noticed that some charactersnbsp;were nbsp;not displayed in the previous version. nbsp; nbsp; Is there a function to calculate thenbsp; prediction intervals for random effects in non-linear mixed models? I found a way to do it for

Re: [R] candisc() error message

2008-06-16 Thread Michael Friendly
John is correct the error message you got was clear: the error SSP matrix is of deficient rank. Possible solutions: - Regroup the factor levels to fewer and/or - Combine some of the species to broader classes so you have fewer than 17 response variables - Collect more samples hope this

Re: [R] Linear Regression ?

2008-06-16 Thread Roland Rau
Hi, did you have a look at the manual An Introduction to R? (http://cran.r-project.org/doc/manuals/R-intro.html). Chapter Statistical Models in R should answer (most of) your questions concerning linear regression. kayj wrote: Also each x is a categorical variable with 4 categories so I

[R] Plotting 3d data?

2008-06-16 Thread Wesley Tansey
Hi all! I'm very new to R, and I'm having trouble figuring out how to go from a file of points that I have to a 3d surface plot of the data. I typically have something like this: X Y Z 0.0050.02334.45 0.0035 0.63 28.48 . I've tried looking at the

Re: [R] Plotting 3d data?

2008-06-16 Thread Henrique Dallazuanna
Try scatterplot3d function in the package with same name. On Mon, Jun 16, 2008 at 2:32 PM, Wesley Tansey [EMAIL PROTECTED] wrote: Hi all! I'm very new to R, and I'm having trouble figuring out how to go from a file of points that I have to a 3d surface plot of the data. I typically have

[R] 回复: cch() and coxph() for case-coh ort

2008-06-16 Thread Jin Wang
I tried to compare if cch() and coxph() can generate same result for same case cohort data Use the standard data in cch(): nwtco Since in cch contains the cohort size=4028, while ccoh.data size =1154 after selection, but coxph does not contain info of cohort size=4028. The rough estimate

Re: [R] using spec.pgram

2008-06-16 Thread Anthony Mathelier
OK, it seems like I do not succeed in expressing what I do, or want to do. So, I give you the example that bring me to this kind of analysis. I wrote the paper Chromosomal periodicity of evolutionary conserved gene pairs (which you can download at http://www.pnas.org/cgi/reprint/104/25/10559). In

Re: [R] ggplot2: How to remove legend component for geom_errorbar() ?

2008-06-16 Thread Carsten Jaeger
Hi Hadley, thanks for your tip! It worked fine (though I had to use tile instead of point). I see your point to handle legends the way you do, which is a very convenient feature of ggplot. It's great for points, lines, bars etc., but in the particular case of error bars, I think it would be

[R] Lattice: Superpose bwplot on dotplot [Newbie Question]

2008-06-16 Thread Lord Yo
Hello everyone I have dataset containing a monetary value (ABS) and two factors (Fct, Group). I am able to create useful using: bwplot(ABS~Group|Fct) and dotplot(ABS~Group|Fct) Question: What do I have to do to overlay the dotplot with the bwplot (same data set)? I've found a couple of

[R] Error in maximum likelihood estimation.

2008-06-16 Thread Dong-hyun Oh
Dear UseRs, I wrote the following function to use MLE. - mlog - function(theta, nx = 1, nz = 1, dt){ beta - matrix(theta[1:(nx+1)], ncol = 1) delta - matrix(theta[(nx+2):(nx+nz+1)], ncol = 1) sigma2 - theta[nx+nz+2] gamma - theta[nx+nz+3] y -

Re: [R] save workspace while running R on a cluster

2008-06-16 Thread Manisha Brahmachary
Thanks your suggestion works -:-) From: milton ruser [mailto:[EMAIL PROTECTED] Sent: Thursday, June 12, 2008 2:42 PM To: Manisha Brahmachary Cc: r-help@r-project.org Subject: Re: [R] save workspace while running R on a cluster Hi Manisha, How about you

[R] Creating correlated multivariate dataset

2008-06-16 Thread sk
Hello list, I am trying to test a model but for the beginning I want to do this by using simulated dataset. The model is Y_t = X_t %*% beta + e Where Y : (Nx1); X: (Nxp); beta: (0.6,0.3,0.1); e-uncorrelated normally distributed variates for each t. and later I want to use to use this

[R] pvclust distance matrix

2008-06-16 Thread Strobel, Bradley
Hello, I am attempting to assign significance levels to a UPGMA cluster analysis as part my doctoral research. The pvclust function works well but doesn't include the similarity index I need (morisita's) as an option for computing a distance matrix. Morisita's is available in vegdist in the

[R] minimizing title's police

2008-06-16 Thread hanen
in order to minimize the police of the title of my graph i tried to use: title(nombre de fleurs données journellement par 6 cereus peruvianus du 1/07/02 au 31/09/02,font=0) but this message appears: Erreur dans title(nombre de fleurs données journellement par 6 cereus peruvianus de 1/07/02 au

[R] Dual axis labeling of a single quantity

2008-06-16 Thread Thomas Adams
I have a problem where I need to label the vertical axes of a Boxplot with related, but different quantities (flow height), which have a known relationship. Primarily I want to plot the variable as a flow on the left axis and on the opposing right axis, show the corresponding height. Is it

Re: [R] left-aligned title?

2008-06-16 Thread Henrique Dallazuanna
Try with mtext: plot(rnorm(100)) mtext(text = Left, side = 3, adj = 0) On Mon, Jun 16, 2008 at 2:39 PM, Carlos Gershenson [EMAIL PROTECTED] wrote: Hi, I am trying to insert a letter in a plot corner outside the plotting area. Thus, legend and text don't seem to work. title does the trick,

[R] in axis() suppressing axis line but keeping tick marks

2008-06-16 Thread Andrew Yee
I've been trying to figure out a parameter that will let you separately adjust the parameters for the axis line from the tick mark. In the following example, I would like to suppress the axis line, but keep the tick marks. Thanks, Andrew foo - data.frame(x=1:3, y=4:6) plot(foo$x, foo$y,

Re: [R] prediction intervals for random effects in nlme

2008-06-16 Thread Dieter Menne
Marc Bernard bernarduse1 at yahoo.fr writes: Is there a function to calculate thenbsp; prediction intervals for random effects in non-linear mixed models? I found a way to do it for linear mixed models but not for non-linearnbsp;mixed one. Please do not send HTML mail to the list. A

[R] barplot with color coding according to value

2008-06-16 Thread maria
Hello, I want to use R to produce nice meteograms... For this I would need to color-code my barplot according to the value plotted say if value x 30 ... the bar is red ; if x between 20 and 10, the bar is blue etc... any ideas how to proceed ? Thank You a lot, maria

Re: [R] cch() and coxph() for case-cohort

2008-06-16 Thread Terry Therneau
- begin included message - I tried to compare if cch() and coxph() can generate same result for same case cohort data Use the standard data in cch(): nwtco Since in cch contains the cohort size=4028, while ccoh.data size =1154 after selection, but coxph does not contain info of

Re: [R] barplot with color coding according to value

2008-06-16 Thread Henrique Dallazuanna
Perhaps something like this: x - sample(10:50, 10, rep=TRUE) cols - as.character(cut(x, breaks = c(0, 10, 20, 30,max(x)), labels = c(green, blue, yellow, red))) barplot(x, col = cols) On Mon, Jun 16, 2008 at 4:15 PM, [EMAIL

[R] error in runif

2008-06-16 Thread Yasin Hajizadeh
Hi all I would be grateful you can help me with my problem. I try to run an optimization code . in one line I have runif in order to sample the PDF. I get this error while i run it. Error in runif(1, f$d[[n.of.u.vars + n.of.o.vars + j]][[2]][1], f$d[[n.of.u.vars + : invalid

Re: [R] minimizing title's police

2008-06-16 Thread Patrick Connolly
On Mon, 16-Jun-2008 at 11:35AM -0700, hanen wrote: | | | in order to minimize the police of the title of my graph i tried to use: | | title(nombre de fleurs données journellement par 6 cereus peruvianus du | 1/07/02 au 31/09/02,font=0) | | but this message appears: | | Erreur dans

Re: [R] 回复: cch() and coxph() for case-c ohort

2008-06-16 Thread Peter Dalgaard
Jin Wang wrote: I tried to compare if cch() and coxph() can generate same result for same case cohort data Use the standard data in cch(): nwtco Since in cch contains the cohort size=4028, while ccoh.data size =1154 after selection, but coxph does not contain info of cohort size=4028. The

[R] Annoyance in as.numeric

2008-06-16 Thread Alberto Monteiro
Why does as.numeric convert matrices and arrays to vectors? as.numeric(matrix(c(1, 2, 3, 4), 2, 2)) [1] 1 2 3 4 I could only figure out ugly ways to bypass this, like: x - matrix(c(1, 2, 3, 4), 2, 2) array(as.numeric(x), dim = dim(x), dimnames = dimnames(x)) Alberto Monteiro

[R] weights in lmer

2008-06-16 Thread Brian S Cade
I originally sent this to Doug Bates but have received no reply yet so I thought I would expand to a wider source. I've been trying to estimate linear mixed effect models in lmer() from the lme4 package using the weights option. The help and code for lmer() suggest to me that this is

[R] surface plotting

2008-06-16 Thread Floyd poole
I am new to R and what to find out which package would be best to create a surface plot, 2d or 3d if possible. I have a matrix (depth.dat) which has over 15k depth measurements from an ultrasonic corrosion mapping application. These depth measurements only have one axis (x) but I have used Octave

Re: [R] Plotting 3d data?

2008-06-16 Thread Duncan Murdoch
On 6/16/2008 1:32 PM, Wesley Tansey wrote: Hi all! I'm very new to R, and I'm having trouble figuring out how to go from a file of points that I have to a 3d surface plot of the data. I typically have something like this: X Y Z 0.0050.02334.45 0.0035 0.63

Re: [R] Annoyance in as.numeric

2008-06-16 Thread markleeds
hi: you can do below but i don't know if it's worth it ? newx - data.matrix(data.frame(x)) print(newx) On Mon, Jun 16, 2008 at 4:22 PM, Alberto Monteiro wrote: Why does as.numeric convert matrices and arrays to vectors? as.numeric(matrix(c(1, 2, 3, 4), 2, 2)) [1] 1 2 3 4 I could only

Re: [R] surface plotting

2008-06-16 Thread Duncan Murdoch
On 6/16/2008 4:40 PM, Duncan Murdoch wrote: On 6/16/2008 4:25 PM, Floyd poole wrote: I am new to R and what to find out which package would be best to create a surface plot, 2d or 3d if possible. I have a matrix (depth.dat) which has over 15k depth measurements from an ultrasonic corrosion

Re: [R] in axis() suppressing axis line but keeping tick marks

2008-06-16 Thread Peter Dalgaard
Andrew Yee wrote: I've been trying to figure out a parameter that will let you separately adjust the parameters for the axis line from the tick mark. In the following example, I would like to suppress the axis line, but keep the tick marks. The source code is the ultimate reference. We have

Re: [R] in axis() suppressing axis line but keeping tick marks

2008-06-16 Thread Andrew Yee
Thanks for tracking this down. Andrew On Mon, Jun 16, 2008 at 4:49 PM, Peter Dalgaard [EMAIL PROTECTED] wrote: Andrew Yee wrote: I've been trying to figure out a parameter that will let you separately adjust the parameters for the axis line from the tick mark. In the following example, I

Re: [R] Plotting 3d data?

2008-06-16 Thread Wesley Tansey
If your data is really a bunch of points, not on a grid, then you need to use plot3d() to plot it as points, or convert it to a surface. The interp() function in the akima package can do that. (There are lots of other possibilities too.) Actually, my data is on a grid. The values are

[R] Error bars within xyplot, panel = function(x,y, ....)

2008-06-16 Thread David Afshartous
All, I'm trying to adapt some code provided by Deepayan Sarkar from a previous thread (https://stat.ethz.ch/pipermail/r-help/2005-October/081571.html) on this topic. ## This code produces a graph w/o error bars: xyplot(Y ~ Hr, data, groups=DRUG, panel=function(x,y,...){

Re: [R] Superimposing Line over Histogram in Density Plot

2008-06-16 Thread Carl Witthoft
I do it a bit differently: Once you've got myhist, you can plot a line on the existing histogram plot with something like: smoo-spline(myhist$breaks[1:length(myhist$breaks)-1],myhist$counts) lines(smoo$x,smoo$y,col='green') You'll have to muck a bit with scale factors to make the spline curve

Re: [R] Annoyance in as.numeric

2008-06-16 Thread Gavin Simpson
On Mon, 2008-06-16 at 15:35 -0500, [EMAIL PROTECTED] wrote: hi: you can do below but i don't know if it's worth it ? newx - data.matrix(data.frame(x)) print(newx) That doesn't work Mark: str(data.frame(x)) 'data.frame': 2 obs. of 2 variables: $ X1: Factor w/ 2 levels 1,2: 1 2 $ X2:

[R] Lattice: Superpose bwplot and dotplot [newbie question]

2008-06-16 Thread Lord Yo
Hello everyone I have dataset containing a monetary value (ABS) and two factors (Fct, Group). I am able to create useful using: bwplot(ABS~Group|Fct) and dotplot(ABS~Group|Fct) Question: What do I have to do to overlay the dotplot with the bwplot (same data set)? I've found a couple of posts

Re: [R] Annoyance in as.numeric

2008-06-16 Thread Bert Gunter
On Mon, Jun 16, 2008 at 4:22 PM, Alberto Monteiro wrote: Why does as.numeric convert matrices and arrays to vectors? Because that's what it's documented to do! as.numeric is a generic function, but S3 methods must be written for as.double. It is identical to as.double (and as.real). And

[R] Constrained Optimized Binning Procedure....implementation help/idea needed.

2008-06-16 Thread Marko Milicic
Dear R Helpers, At the moment I'm working on the project to implement optimal binning function. It will be primarily used as a tool for logistic regression. something very similar to http://www2.sas.com/proceedings/forum2008/153-2008.pdf* *but applied in diferent problem space...* *The

Re: [R] Annoyance in as.numeric

2008-06-16 Thread Taylor, Z Todd
I generally do something like storage.mode(my.matrix) - double --Todd -- Why do you recite at a play and play at a recital? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gavin Simpson Sent: Monday, June 16, 2008 2:31 PM To: [EMAIL

Re: [R] Annoyance in as.numeric

2008-06-16 Thread markleeds
thanks for your correction Gavin. i read ?data.matrix and neglected to pay attention to the last line of the description: Factors and ordered factors are replaced by their internal codes. On Mon, Jun 16, 2008 at 5:30 PM, Gavin Simpson wrote: On Mon, 2008-06-16 at 15:35 -0500, [EMAIL

  1   2   >