Re: [R] compiling under windows

2005-07-01 Thread Prof Brian Ripley
On Thu, 30 Jun 2005, Philip Bermingham wrote: What is the best way to set up a project in visual studio, work on R and re compile? Is it better to use a different compiler or programming environment? I specifically want to work on C and Fortran extensions. See the `R Installation and

[R] Nolinear mixed-effects models (nlme)

2005-07-01 Thread Alex Bach
Hello, I am trying to fit a nonlinear model of the form of: A*x^b*exp(-c*x) This represents a lactation curve. I have a bunch of cows, so I want COW to be a random effect. I have been trying the following code with very littel success: fm1 - nlme(yield ~ A*(DIM^B)*(exp(-C*DIM)), +

[R] p-values for classification

2005-07-01 Thread Arne.Muller
Dear All, I'm classifying some data with various methods (binary classification). I'm interpreting the results via a confusion matrix from which I calculate the sensitifity and the fdr. The classifiers are trained on 575 data points and my test set has 50 data points. I'd like to calculate

Re: [R] [OT] gmail filter for R-help and R-devel lists

2005-07-01 Thread ecoinfo
One filter is enough: to: r-help Xiaohua On 6/30/05, Matthew Nelson [EMAIL PROTECTED] wrote: A clarification: this only works properly when the To addresses are in separate filters. Sorry for the confusion. Matt On 6/30/05, Matthew Nelson [EMAIL PROTECTED] wrote: Doug, I

[R] loop over large dataset

2005-07-01 Thread Federico Calboli
Hi All, I'd like to ask for a few clarifications. I am doing some calculations over some biggish datasets. One has ~ 23000 rows, and 6 columns, the other has ~62 rows and 6 columns. I am using these datasets to perform a simulation of of haplotype coalescence over a pedigree (the datestes

[R] the format of the result

2005-07-01 Thread ronggui
I write a function to get the frequency and prop of a variable. freq-function(x,digits=3) {naa-is.na(x) nas-sum(naa) if (any(naa)) x-x[!naa] n-length(x) ta-table(x) prop-prop.table(ta)*100 res-rbind(ta,prop) rownames(res)-c(Freq,Prop) cat(Missing value(s) are,nas,.\n) cat(Valid case(s) are,n,.\n)

[R] Simple indexing conundrum

2005-07-01 Thread Martin Henry H. Stevens
My apologies in advance for my thickness but I can't seem to solve the following, seemingly simple, data manipulation problem: I have a data frame that contains multiple factors and multiple continuous response variables, but duplicates of some factor combinations. The duplicates contain bad

Re: [R] p-values for classification

2005-07-01 Thread Prof Brian Ripley
Not really an R question. Most classifiers will produce predicted probabilities, and you can check their accuracy. There are lots of details in my PRNN book, and some examples in MASS4. I suggest you adjust your training and test sets to be more nearly equal, or use cross-validation. I

[R] R integration with Microsoft Powerpoint

2005-07-01 Thread John Sorkin
Please allow me an unusual question. Is there any way that R can be closely integrated with a Microsoft Powerpoint presentation? I would like to embed R calculations in Powerpoint so that I will start Powerpoint, be prompted to enter some parameters, and an R function will run and return values

[R] [R-pkgs] New CRAN package relax: R Editor for Literate Analysis and lateX

2005-07-01 Thread Peter Wolf
Now package relax is on CRAN. The name relax is short for R Editor for Literate Analysis and lateX The main element of package relax is the function relax() which starts an all-in-one editor for data analysis and easy creation of LaTeX based documents with R. After calling relax() it

[R] barplot legend

2005-07-01 Thread Navarre Sabine
Hi, Is it possible ti put the legend out of a barplot? tanks Sabine - [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list

Re: [R] loop over large dataset

2005-07-01 Thread Liaw, Andy
My suggestion is that you try to vectorize the computation as much as you can. From what you've shown, `new' and `ped' need to have the same number of rows, right? Your `off' function seems to be randomly choosing between columns 1 and 2 from its two input matrices (one row each?). You may want

[R] It is time to say thank you.

2005-07-01 Thread John Sorkin
I would like to express my thanks to the many people who got together and developed the R project. The idea, and work, of organizing and, for no compensation, supporting an open software project must have been (and still be) daunting. It is clear that the availability of a free, high-quality

Re: [R] Simple indexing conundrum

2005-07-01 Thread Liaw, Andy
Is this close to what you want? air.sub - do.call(rbind, lapply(split(airquality, airquality$Month), +function(d) d[which.max(d$Solar.R),])) air.sub Ozone Solar.R Wind Temp Month Day 514 334 11.5 64 5 16 6NA 332 13.8 80 6 14 7

Re: [R] barplot legend

2005-07-01 Thread Marc Schwartz
On Fri, 2005-07-01 at 14:04 +0200, Navarre Sabine wrote: Hi, Is it possible ti put the legend out of a barplot? tanks Sabine I presume that you mean outside the plot region? If so, you can use something like the following: # Adjust the plot margins to make room for the # legend

Re: [R] Simple indexing conundrum

2005-07-01 Thread Jim Brennan
Here is a different approach I only send since the result is slightly different in that two rows are returned for Month 9 and the original row number is retained. max2-function(x){max(x,na.rm=T)} MonthMax-ave(Solar.R,Month,FUN=max2) new-subset(airquality,Solar.R==MonthMax)

[R] 10^k axis labels {was .. (log scale on y-axis)}

2005-07-01 Thread Martin Maechler
Gabor == Gabor Grothendieck [EMAIL PROTECTED] on Thu, 30 Jun 2005 07:28:30 -0400 writes: Gabor On 6/29/05, Jing Shen [EMAIL PROTECTED] wrote: I am planning to plot my data on log scale (y-axis). There is a parameter in plot function, which is plot( ..., log=y, ...)

Re: [R] FW: plot legend outside the grid

2005-07-01 Thread Uwe Ligges
In principle you are there, just after opening the device set par(mar) appropriate (large margin to place the legend in) before starting with plotting. In the legend, specify points which virtually are in the margin you have already expanded... Uwe Ligges Ghosh, Sandeep wrote:

Re: [R] Simple indexing conundrum

2005-07-01 Thread Martin Henry H. Stevens
Thank guys! Both solutions do what I need. Thanks. Hank On Jul 1, 2005, at 8:45 AM, Jim Brennan wrote: Here is a different approach I only send since the result is slightly different in that two rows are returned for Month 9 and the original row number is retained.

Re: [R] 10^k axis labels {was .. (log scale on y-axis)}

2005-07-01 Thread Gabor Grothendieck
On 7/1/05, Martin Maechler [EMAIL PROTECTED] wrote: Gabor == Gabor Grothendieck [EMAIL PROTECTED] on Thu, 30 Jun 2005 07:28:30 -0400 writes: Gabor On 6/29/05, Jing Shen [EMAIL PROTECTED] wrote: I am planning to plot my data on log scale (y-axis). There is a parameter in

Re: [R] Reconstructing LD function

2005-07-01 Thread usenet
On Mon, 2005-06-27 at 13:18, Prof Brian Ripley wrote: On Mon, 27 Jun 2005 [EMAIL PROTECTED] wrote: in an LDA analysis with n groups n-1 LD functions result. Implicitly this defines an LD fucntion for the last group. Does there exist code already to explictly construct this LD function?

Re: [R] Reconstructing LD function

2005-07-01 Thread Prof Brian Ripley
On Fri, 1 Jul 2005 [EMAIL PROTECTED] wrote: On Mon, 2005-06-27 at 13:18, Prof Brian Ripley wrote: On Mon, 27 Jun 2005 [EMAIL PROTECTED] wrote: in an LDA analysis with n groups n-1 LD functions result. Implicitly this defines an LD fucntion for the last group. Does there exist code already

Re: [R] Nolinear mixed-effects models (nlme)

2005-07-01 Thread Douglas Bates
On 6/30/05, Alex Bach [EMAIL PROTECTED] wrote: Hello, I am trying to fit a nonlinear model of the form of: A*x^b*exp(-c*x) This represents a lactation curve. I have a bunch of cows, so I want COW to be a random effect. You need to decide which of the model parameters (i.e. A, B and C)

[R] plot svm

2005-07-01 Thread bgmail
Hello I'm working with DNA microarrays and want to classify them with SVM. I want to plot the results and it's imposible for me. I found others tutorials and examples (with iris and cats data) where you can plot the results with plot.svm, but you need to write a formula and I don't know how

Re: [R] R integration with Microsoft Powerpoint

2005-07-01 Thread Prof Brian Ripley
On Fri, 1 Jul 2005, John Sorkin wrote: Please allow me an unusual question. Is there any way that R can be closely integrated with a Microsoft Powerpoint presentation? I would like to embed R calculations in Powerpoint so that I will start Powerpoint, be prompted to enter some parameters,

Re: [R] [OT] gmail filter for R-help and R-devel lists

2005-07-01 Thread Suresh Krishna
i dont use gmail, but this method *may* run into problems if people are replying to a message and r-help is on the cc: line. thunderbird has a to: or cc: option for this... is gmail's to: field a default for to: or cc: ? -s. Deepayan Sarkar wrote: On 6/30/05, Douglas Bates [EMAIL PROTECTED]

[R] the format of the result

2005-07-01 Thread khobson
See ?sprintf #e.g. Replace your prop line with: prop-sprintf(%.2f%%, prop.table(ta)*100) _ mailto:[EMAIL PROTECTED] Kenneth Ray Hobson, P.E. Oklahoma DOT - QA IAS Manager 200 N.E. 21st Street Oklahoma City, OK 73105-3204 (405) 522-4985, (405) 522-0552 fax Visit our website at:

Re: [R] [OT] gmail filter for R-help and R-devel lists

2005-07-01 Thread ecoinfo
Yes, Douglas has proved this. On 7/1/05, Suresh Krishna [EMAIL PROTECTED] wrote: i dont use gmail, but this method *may* run into problems if people are replying to a message and r-help is on the cc: line. thunderbird has a to: or cc: option for this... is gmail's to: field a default

[R] R integration with Microsoft Powerpoint

2005-07-01 Thread khobson
Sure. Just run R in a BAT file. You just reference the BAT file in PowerPoint like any other EXE application via an OLE link. Of course you can always use VBA code in Powerpoint to Shell() to the BAT program. In R, type ?BATCH to see how the BAT file's content line should be coded to run

Re: [R] ranking predictive features in logsitic regression

2005-07-01 Thread David Firth
On 30 Jun, 2005, at 21:20, Stephen Choularton wrote: Hi Is there some function R that multiplies each coefficient by the standard deviation of the corresponding variable and produces a ranking? Possibly you meant un-signed coefficients? In which case something like function(model)

[R] OT: How to instaill gcc in cygwin?

2005-07-01 Thread Wensui Liu
Dear Listers, I know it is far off topic. But I do know there must be some people here who know it very well. Sorry for bothering others. Thanks. -- WenSui Liu, MS MA Senior Decision Support Analyst Division of Health Policy and Clinical Effectiveness Cincinnati Children Hospital Medical

[R] Calculate 3D Fixed Kernel Home Range

2005-07-01 Thread Jared Stabach
I have x,y data on three animals (~150 data points each). I have calculated the fixed kernel home range using the 'adehabitat' library and the LSCV smoothing factor. Can anyone provide me with some help on how to display the density estimate of the Utilization Distribution 3-dimensionally?

Re: [R] the format of the result

2005-07-01 Thread Marc Schwartz (via MN)
On Fri, 2005-07-01 at 19:40 +0800, ronggui wrote: I write a function to get the frequency and prop of a variable. freq-function(x,digits=3) {naa-is.na(x) nas-sum(naa) if (any(naa)) x-x[!naa] n-length(x) ta-table(x) prop-prop.table(ta)*100 res-rbind(ta,prop) rownames(res)-c(Freq,Prop)

[R] Lines for plot (Sweave)

2005-07-01 Thread Doran, Harold
Dear List: I am generating a series of plots iteratively using Sweave. In short, a dataframe is subsetted row by row and variable graphics are created conditional on the data in each row. In this particular case, this code ends up generating 17,000 individual plots. In some cases, all student

Re: [R] Lines for plot (Sweave)

2005-07-01 Thread Gabor Grothendieck
On 7/1/05, Doran, Harold [EMAIL PROTECTED] wrote: Dear List: I am generating a series of plots iteratively using Sweave. In short, a dataframe is subsetted row by row and variable graphics are created conditional on the data in each row. In this particular case, this code ends up generating

[R] zlim for levelplot

2005-07-01 Thread Tao Shi
__ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Re: [R] Lines for plot (Sweave)

2005-07-01 Thread Doran, Harold
Fabulous, it works great. I didn't know about approx(). Thank you -Original Message- From: Gabor Grothendieck [mailto:[EMAIL PROTECTED] Sent: Friday, July 01, 2005 1:54 PM To: Doran, Harold Cc: r-help@stat.math.ethz.ch Subject: Re: [R] Lines for plot (Sweave) On 7/1/05, Doran, Harold

Re: [R] R integration with Microsoft Powerpoint

2005-07-01 Thread khobson
Of course there are many ways to do it. The user input could come from R dialogs via the tcltk package or the Input() dialogs from VBA in Powerpoint. I chose the output as PDF. The R source code called cars.r, might go something like: pdf(file=paste(getwd(), /, cars.pdf, sep=), width =

[R] R integration with Microsoft Powerpoint

2005-07-01 Thread khobson
...snip...In PowerPoint, click the menu item Insert | Object | Create and browse to and select the cars.r file. ...snip... In the previous post snippet above, replace cars.r with cars.bat. To run the cars.bat program via VBA, I would typically insert a button. To do so in PowerPoint, right

[R] lapply

2005-07-01 Thread Weiwei Shi
Hi, all: I have a program here but it runs slow and I am wondering if there is some place I can change to make it run faster. Two lists, scd and c1, like this: scd[1:2] [[1]] [1] 54 241 [[2]] [1] 52 53 ... c1[1:2] [[1]] [1] 13 30 92 93 13 94 30 95 96 97 98 99 [13] 8 19 31 100

Re: [R] OT: How to instaill gcc in cygwin?

2005-07-01 Thread Dirk Eddelbuettel
Wensui Liu liuwensui at gmail.com writes: I know it is far off topic. But I do know there must be some people here who know it very well. Click the 'install now' button at cygwin.org, and when the selection box appears in the install process, also select gcc. There is a _lot_ of stuff

Re: [R] Lines for plot (Sweave)

2005-07-01 Thread Don MacQueen
You can use: lines(x[!is.na[stu.vector], stu.vector[!is.na(stu.vector)], lty=1, col='blue') -Don At 1:43 PM -0400 7/1/05, Doran, Harold wrote: Dear List: I am generating a series of plots iteratively using Sweave. In short, a dataframe is subsetted row by row and variable graphics are

[R] Setting lattice boxplot's lines to black

2005-07-01 Thread Mario Alfonso Morales Rivera
Hi R users. I'm using the lattice library and I need a print version for my graphics. How Set I my boxplot's lines to black tpl-trellis.par.get(plot.line) tpl$col-black trellis.par.set(plot.line, tpl) Don't work. Boxplot's lines aren't black. Thanks a lot. This is my script.

[R] Generating correlated data from uniform distribution

2005-07-01 Thread Menghui Chen
Dear R users, I want to generate two random variables (X1, X2) from uniform distribution (-0.5, 0.5) with a specified correlation coefficient r. Does anyone know how to do it in R? Many thanks! Menghui __ R-help@stat.math.ethz.ch mailing list

Re: [R] Setting lattice boxplot's lines to black

2005-07-01 Thread Deepayan Sarkar
On 7/1/05, Mario Alfonso Morales Rivera [EMAIL PROTECTED] wrote: Hi R users. I'm using the lattice library and I need a print version for my graphics. How Set I my boxplot's lines to black (As I said in a private reply,) you seem to want a black and white plot, so use

Re: [R] Generating correlated data from uniform distribution

2005-07-01 Thread Jim Brennan
dat-matrix(runif(2000),2,1000) rho-.77 R-matrix(c(1,rho,rho,1),2,2) dat2-t(ch)%*%dat cor(dat2[1,],dat2[2,]) [1] 0.7513892 dat-matrix(runif(2),2,1) rho-.28 R-matrix(c(1,rho,rho,1),2,2) ch-chol(R) dat2-t(ch)%*%dat cor(dat2[1,],dat2[2,]) [1] 0.2681669

Re: [R] Generating correlated data from uniform distribution

2005-07-01 Thread Tony Plate
Isn't this a little trickier with non-normal variables? It sounds like Menghui Chen wants variables that have uniform marginal distribution, and a specified correlation. When I look at histograms (or just the quantiles) of the rows of dat2 in your example, I see something for dat2[2,] that

Re: [R] Generating correlated data from uniform distribution

2005-07-01 Thread Spencer Graves
How about tetrachoric correlations? Generate correlated normal observations, then convert to uniform using pnorm: rho - 0.9 Cor - array(c(1, rho, rho, 1), dim=c(2,2)) library(mvtnorm) set.seed(1) Y - rmvnorm(1, sigma=Cor) X - pnorm(Y)-0.5 plot(X) hist(X[,1]) hist(X[,2]) cor(X)

Re: [R] Generating correlated data from uniform distribution

2005-07-01 Thread Jim Brennan
Yes you are right I guess this works only for normal data. Free advice sometimes comes with too little consideration :-) Sorry about that and thanks to Spencer for the correct way. -Original Message- From: Tony Plate [mailto:[EMAIL PROTECTED] Sent: July 1, 2005 6:01 PM To: Jim Brennan Cc:

Re: [R] Generating correlated data from uniform distribution

2005-07-01 Thread Peter Dalgaard
Jim Brennan [EMAIL PROTECTED] writes: Yes you are right I guess this works only for normal data. Free advice sometimes comes with too little consideration :-) Worth every cent... Sorry about that and thanks to Spencer for the correct way. Hmm, but is it? Or rather, what is the relation

[R] scope argument in step function

2005-07-01 Thread Young Cho
Thanks a lot for help in advance. I am switching from matlab to R and I guess I need some time to get rolling. I was wondering why this code : fit.0 - lm( Response ~ 1, data = ds3) step(fit.0,scope=list(upper=~.,lower=~1),data=ds3) Start: AIC= -32.66 Response ~ 1 Call: lm(formula =

Re: [R] Generating correlated data from uniform distribution

2005-07-01 Thread Jim Brennan
OK now I am skeptical especially when you say in a weird way:-) This may be OK but look at plot(x,y) and I am suspicious. Is it still alright with this kind of relationship? For large N it appears Spencer's method is returning slightly lower correlation for the uniforms as compared to the normals

Re: [R] Generating correlated data from uniform distribution

2005-07-01 Thread Spencer Graves
Peter is absolutely correct: The correlation I used was for a hidden normal process, not for the resultant correlated uniforms. This is similar to but different from tetrachoric corrrelations, about which there is a substantial literature (including an R package polycor).

Re: [R] Generating correlated data from uniform distribution

2005-07-01 Thread alejandro munoz
Dear Menghui, You may consider looking in Luc Devroye's Non-uniform Random Number Generation. Despite its title, section XI.3.2 describes how to generate bivariate uniforms. The book is out of print but Devroye himself urges you to print it from his scanned PDFs(!):

[R] as.Date today ?

2005-07-01 Thread Omar Lakkis
I have a Date variable that I constructed with as.Date() How ca I compare it to today (,,==) ? __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide!

Re: [R] as.Date today ?

2005-07-01 Thread Spencer Graves
The following is a minor modification of examples in the help for as.Date: x - c(1jan1960, 2jan1960, 31mar1960, 30jul2006) z - as.Date(x, %d%b%Y) z Sys.Date() [1] TRUE TRUE TRUE FALSE How's this? spencer graves Omar Lakkis wrote: I have a Date variable

[R] Is it possible to use glm() with 30 observations?

2005-07-01 Thread Kerry Bush
I have a very simple problem. When using glm to fit binary logistic regression model, sometimes I receive the following warning: Warning messages: 1: fitted probabilities numerically 0 or 1 occurred in: glm.fit(x = X, y = Y, weights = weights, start = start, etastart = etastart, 2: fitted

Re: [R] Lines for plot (Sweave)

2005-07-01 Thread Gabor Grothendieck
A variation on your idea might be: fo - stu.vector ~ x lines(fo, model.frame(fo), lty=1, col='blue') On 7/1/05, Don MacQueen [EMAIL PROTECTED] wrote: You can use: lines(x[!is.na[stu.vector], stu.vector[!is.na(stu.vector)], lty=1, col='blue') -Don At 1:43 PM -0400 7/1/05, Doran,

Re: [R] Is it possible to use glm() with 30 observations?

2005-07-01 Thread Spencer Graves
The issue is not 30 observations but whether it is possible to perfectly separate the two possible outcomes. Consider the following: tst.glm - data.frame(x=1:3, y=c(0, 1, 0)) glm(y~x, family=binomial, data=tst.glm) tst2.glm - data.frame(x=1:1000, y=rep(0:1,

[R] Can you help?

2005-07-01 Thread Perfect Harmony
Please take the time to read this email. What you might view as spam could be an animals last chance. Animals don't stand a chance without the everyone's help. Some people don't care, some don't think they can make a difference. There is always something YOU can do to help. We desperately