Re: [R] R and LaTeX

2006-12-09 Thread Andrew Robinson
Hi David, I strongly recommend that you use Sweave to mediate LaTeX and R. http://www.ci.tuwien.ac.at/~leisch/Sweave/FAQ.html Cheers Andrew On Sat, Dec 09, 2006 at 10:39:19PM -0600, David Kaplan wrote: > Hi all, > > I have started using LaTeX for writing papers and I have heard that R > work

Re: [R] R and LaTeX

2006-12-09 Thread Ko-Kang Kevin Wang
Hi David, You can export the graphs in (encapsulated) postscript format, or in PDF/PNG/JPEG format. The following functions may be helpful: postscript() png() pdf() You may also want to check out Sweave (http://www.ci.tuwien.ac.at/~leisch/Sweave/), it allows you to integrate LaTeX an

[R] R and LaTeX

2006-12-09 Thread David Kaplan
Hi all, I have started using LaTeX for writing papers and I have heard that R works well with LaTeX. I'm specifically interested in how I can have LaTeX read in R generated graphics - for example graphs formed by matplot, or other such processes. Does anyone out there use LaTeX and can poin

[R] DOE teaching suggestions?

2006-12-09 Thread Erin Hodgess
Dear R People: I will be teaching an undergraduate Design of Experiments class in the Spring Semester. It will be very much an applied course. My question, please: has anyone used R for a course like this, please? I've tried Rcmdr for a regression course and just plain command line for a time

Re: [R] Rcmdr package

2006-12-09 Thread Dirk Eddelbuettel
On 9 December 2006 at 18:29, İbrahim Mutlay wrote: | My intent in installing a newer R version is just an approach that "newer is | better". So, i'm a "teenager" statistician and R user, thus, i can not | discriminate a newer tar.gz package from stable debian packages. But you're | right about tha

[R] convenient way to combine Surv objects?

2006-12-09 Thread Heinz Tuechler
Dear All, is there a convenient way to combine Surv objects? Imagine two Surv objects as in the following example. Is it possible to combine them into one _Surv_ object? I tried rbind(), cbind(), c(), merge(), but none of these function does, what I would like. So I drafted a method for rbind.Surv

Re: [R] Rcmdr package

2006-12-09 Thread İbrahim Mutlay
Dear Dirk (sorry for Mr. etc... formalism), My intent in installing a newer R version is just an approach that "newer is better". So, i'm a "teenager" statistician and R user, thus, i can not discriminate a newer tar.gz package from stable debian packages. But you're right about that i should use

Re: [R] Rcmdr package

2006-12-09 Thread Dirk Eddelbuettel
On 9 December 2006 at 17:09, İbrahim Mutlay wrote: | Dear Mr. Eddelbuettel, [ Well if you want to be formal, Dr Eddelbuettel is more appropriate. But Dirk is easier on your keyboard ... ] | in R, i wrote the command of capabilities(), and the result was such like: | | > capabilities() | Xlib:

Re: [R] Filtering a data frame by regular expression

2006-12-09 Thread Neil McLeod
Thank you so much! It looks like as.character was the missing ingredient. Neil On 12/9/06, Chuck Cleland <[EMAIL PROTECTED]> wrote: > > Neil McLeod wrote: > > Hello, > > > > I am having difficulty filtering a data frame. > > > > I would like to take all the rows of a data frame where column A > co

[R] Multiple label colors for leafs in plot(as.dendrogram(x))

2006-12-09 Thread Phil Novack-Gottshall
__ 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 and provide commented, minimal, self-contained, reproducible code.

Re: [R] Rcmdr package

2006-12-09 Thread İbrahim Mutlay
Dear Mr. Eddelbuettel, in R, i wrote the command of capabilities(), and the result was such like: > capabilities() Xlib: connection to ":0.0" refused by server Xlib: No protocol specified jpeg pngtcltk X11 http/ftp sockets libxml fifo FALSEFALSEFALSEFALSE

Re: [R] Filtering a data frame by regular expression

2006-12-09 Thread jim holtman
> av <- c("UTI","ABC","UIT","UTI","UTI") > grep("UTI", av) [1] 1 4 5 > # if you really want TRUE/FALSE > occurs <- logical(length(av)) > occurs[grep("UTI", av)] <- TRUE > occurs [1] TRUE FALSE FALSE TRUE TRUE > > On 12/9/06, Neil McLeod <[EMAIL PROTECTED]> wrote: > > Hello, > > I am having dif

Re: [R] Filtering a data frame by regular expression

2006-12-09 Thread Chuck Cleland
Neil McLeod wrote: > Hello, > > I am having difficulty filtering a data frame. > > I would like to take all the rows of a data frame where column A contains > the regular expression "UTI" (or some other regex). Here's what I've got: > > utiRE <- function (avector) { > occurs <- c() > r1 <- "UTI"

Re: [R] Rcmdr package

2006-12-09 Thread Dirk Eddelbuettel
On 9 December 2006 at 16:02, İbrahim Mutlay wrote: | Dear R users, | | I want to install the Rcmdr package in a Quantian linux machine, but, when i | tried that, following commands appeared: Well, Quantian should already contain Rcmdr, albeit an older version given that there hasn't been a Quant

Re: [R] Rcmdr package

2006-12-09 Thread Peter Dalgaard
İbrahim Mutlay wrote: > Dear R users, > > I want to install the Rcmdr package in a Quantian linux machine, but, when i > tried that, following commands appeared: > > > ** building package indices ... > * DONE (Rcmdr) > > The downloaded packages are in > /tmp/RtmpuOikyk/downloaded_packages >

[R] Filtering a data frame by regular expression

2006-12-09 Thread Neil McLeod
Hello, I am having difficulty filtering a data frame. I would like to take all the rows of a data frame where column A contains the regular expression "UTI" (or some other regex). Here's what I've got: utiRE <- function (avector) { occurs <- c() r1 <- "UTI" for (x in avector) { if (!is.na(grep(r

[R] Rcmdr package

2006-12-09 Thread İbrahim Mutlay
Dear R users, I want to install the Rcmdr package in a Quantian linux machine, but, when i tried that, following commands appeared: ** building package indices ... * DONE (Rcmdr) The downloaded packages are in /tmp/RtmpuOikyk/downloaded_packages > library("Rcmdr") Loading required packa

Re: [R] Show number at risk on Kaplan Meier curve

2006-12-09 Thread Charles C. Berry
On Sat, 9 Dec 2006, Mark Wardle wrote: > Dear all, > > I'm using the "survival" package with R 2.4.0 on Mac OS X 10.4.8. > > I have two core statistics books (one of which is Altman's medical stats > book) which suggest showing the number of individuals at risk at > different time intervals on the

[R] WinBUGS14 and R

2006-12-09 Thread Chris Linton
I'm trying to call BUGS from R. But it's not working. R freezes up and BUGS gives me a strange output in the log. Just to know, BUGS is registered. The modified date on the keys file is today (Dec. 9th). It should be fully registered so that I can use it fully. And, the BUGS model is syntacti

Re: [R] Precision - or lack there of

2006-12-09 Thread John Sorkin
Ducan, First, thank you for your reply. As I previously noted in a reply to Peter Dalgaard, you, and he, are correct. I missed something quite obvious. Sometimes it does not pay to do statistics early in the morning! Again, many thanks, John John Sorkin M.D., Ph.D. Chief, Biostatistics and Inform

[R] Show number at risk on Kaplan Meier curve

2006-12-09 Thread Mark Wardle
Dear all, I'm using the "survival" package with R 2.4.0 on Mac OS X 10.4.8. I have two core statistics books (one of which is Altman's medical stats book) which suggest showing the number of individuals at risk at different time intervals on the Kaplan-Meier curve. My plot shows two curves that

Re: [R] Error in rmultinom(n, size, prob) : too few positive probabilities

2006-12-09 Thread Uwe Ligges
Ethan Johnsons wrote: > // R 2.3.1 > > Can someone please explain why this error returns? > >> y=numeric(100) >> x=matrix(runif(16),4,4) >> for(i in 2:100) > +{ > + y[i]=which(rmultinom(1, size = 1, prob = x[y[i-1], ])==1) > +} > Error in rmultinom(n, size, prob) : too few positive

[R] Error in rmultinom(n, size, prob) : too few positive probabilities

2006-12-09 Thread Ethan Johnsons
// R 2.3.1 Can someone please explain why this error returns? > y=numeric(100) > x=matrix(runif(16),4,4) > for(i in 2:100) +{ + y[i]=which(rmultinom(1, size = 1, prob = x[y[i-1], ])==1) +} Error in rmultinom(n, size, prob) : too few positive probabilities thx much ej __

Re: [R] R in linux

2006-12-09 Thread Charles C. Berry
On Sat, 9 Dec 2006, Nuno Vale wrote: > Hi again, thank you for your reply but i wanted something a bit diferent. > I have R in linux but cant get a graphical interface working so i am running > from the console. > How do i run a program i've writen. I have it saved as a file but cant seem > to fin

[R] Survfit plots in trellis graphics

2006-12-09 Thread Marco Chiarandini
Dear all, is there a way to produce survfit plots in a trellis environment? I am trying this: print(Ecdf(~time | size*type, groups=alg,data=B,subscripts=TRUE, panel=function(x,groups,subscripts) { t <- survfit(Surv(time[subscripts],event[subscripts])~groups

Re: [R] Precision - or lack there of

2006-12-09 Thread Duncan Murdoch
On 12/9/2006 9:26 AM, John Sorkin wrote: > R 2.3.1 > Windows XP > > I am surprised at the lack of precision in R, as noted below. I would > expect the values to be closer to zero, particularly the later examples > where the sample size is quite large. These are all cases where the theoretical di

Re: [R] Count cases by indicator

2006-12-09 Thread Adrian DUSA
Dear Serguei and Andy, I was away for a few days so I appologize for this late reply. I cannot help but noticing Serguei's problem is somewhat suited to the QCA package. For example, the 2^k combinations can be created simply with: library(QCA) cmat <- createMatrix(9) As to the problem itself,

[R] R in linux

2006-12-09 Thread Nuno Vale
Hi again, thank you for your reply but i wanted something a bit diferent. I have R in linux but cant get a graphical interface working so i am running from the console. How do i run a program i've writen. I have it saved as a file but cant seem to find out how to execute it. Is it in R, or do i use

Re: [R] Precision - or lack there of

2006-12-09 Thread Peter Dalgaard
John Sorkin wrote: > R 2.3.1 > Windows XP > > I am surprised at the lack of precision in R, as noted below. I would > expect the values to be closer to zero, particularly the later examples > where the sample size is quite large. > > >> mean(rnorm(500,0,1)) >> > [1] -0.03209727 > >> mea

Re: [R] Precision - or lack there of

2006-12-09 Thread John Sorkin
Indeed, you are correct! In never pays to do stats too early in the morning! John John Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics Baltimore VA Medical Center GRECC, University of Maryland School of Medicine Claude D. Pepper OAIC, University of Maryland Clinical Nutrition Research Unit

[R] Precision - or lack there of

2006-12-09 Thread John Sorkin
R 2.3.1 Windows XP I am surprised at the lack of precision in R, as noted below. I would expect the values to be closer to zero, particularly the later examples where the sample size is quite large. > mean(rnorm(500,0,1)) [1] -0.03209727 > mean(rnorm(5000,0,1)) [1] -0.005991322 > mean(rnorm(5000

Re: [R] Simulation with R

2006-12-09 Thread Ben Bolker
Ethan Johnsons gmail.com> writes: > > An apparatus exists ... > > Can we do a simulation of the process using R with 100 balls, and plot > the frequency distribution of the position of the balls at the bottom > with respect to the entry position? > Can you make a plausible case that this is

Re: [R] svm plot question

2006-12-09 Thread David Meyer
Aimin: hard to tell. IMO, without specifying defaults, it could only work with purely numeric data since factors were wrongly processed. David. Aimin Yan wrote: > thanks, I did get this plot. > Before I have this problem, I did get a plot by my code. > However after I change a little my code. it

[R] [OT] sorry for sending two mails ... and thank's for the answers

2006-12-09 Thread Knut Krueger
Does anybody know why this mail did not appear for more than 6 hours? I thought that my URL might be at any blacklist, so I created a web.de account and resent the mail after a couple of hours. Regards Knut __ R-help@stat.math.ethz.ch mailing list http

Re: [R] Run Sample R (Linux)

2006-12-09 Thread Peter Dalgaard
Nuno Vale wrote: > Hi, all > How do I run sample R (Linux). I open R, find a prompt an now what? > Start by reading the "Introduction to R" manual. It is probably available somewhere in your installation (different linux versions have it in different places), or from http://cran.r-project.org/