Re: [R] Advice on obscuring unique IDs in R

2011-01-05 Thread Marc Schwartz
On Jan 5, 2011, at 3:19 PM, Anthony Staines wrote: Dear colleagues, This may be a question with a really obvious answer, but I can't find it. I have access to a large file with real medical record identifiers (mixed strings of characters and numbers) in it. These represent medical events

[R] convert expressions to characters

2011-01-05 Thread Yihui Xie
Hi, Suppose I have x = parse(text = {y=50+50+50#'asfasf' } ) now x is an expression with some src attributes. x expression({y=50+50+50#'asfasf' }) attr(,srcfile) text attr(,wholeSrcref) {y=50+50+50#'asfasf' } My question is, how can I get my string back (the string passed to parse() as the

Re: [R] Plotting colour-coded points

2011-01-05 Thread John Kane
With xx as your data.frame library(ggplot2) qplot(a, id, data=xx, color=b) --- On Wed, 1/5/11, ANJAN PURKAYASTHA anjan.purkayas...@gmail.com wrote: From: ANJAN PURKAYASTHA anjan.purkayas...@gmail.com Subject: [R] Plotting colour-coded points To: r-help@r-project.org Received: Wednesday,

Re: [R] convert expressions to characters

2011-01-05 Thread David Winsemius
On Jan 5, 2011, at 4:47 PM, Yihui Xie wrote: Hi, Suppose I have x = parse(text = {y=50+50+50#'asfasf' } ) now x is an expression with some src attributes. x expression({y=50+50+50#'asfasf' }) attr(,srcfile) text attr(,wholeSrcref) {y=50+50+50#'asfasf' } My question is, how can I get

Re: [R] convert expressions to characters

2011-01-05 Thread Duncan Murdoch
On 11-01-05 4:47 PM, Yihui Xie wrote: Hi, Suppose I have x = parse(text = {y=50+50+50#'asfasf' } ) now x is an expression with some src attributes. x expression({y=50+50+50#'asfasf' }) attr(,srcfile) text attr(,wholeSrcref) {y=50+50+50#'asfasf' } My question is, how can I

Re: [R] Match numeric vector against rows in a matrix?

2011-01-05 Thread David Winsemius
On Jan 5, 2011, at 2:16 PM, Kevin Ummel wrote: Two posts in one day is not a good day...and this question seems like it should have an obvious answer: I have a matrix where rows are unique combinations of 1's and 0's: combs=as.matrix(expand.grid(c(0,1),c(0,1))) combs Var1 Var2 [1,]

[R] pattern recognition with paths

2011-01-05 Thread Benjamin Polidore
I'm trying to identify patterns among various paths like the following: http://i.imgur.com/bQPI3.png If I plot these, I can observe intuitively two different patterns: a front loaded (1 and 3) and a backloaded (2,4) progress path: http://i.imgur.com/L5qwZ.png I have thousands of observations

Re: [R] Comparing fitting models

2011-01-05 Thread Greg Snow
The output with all three fits gives you 2 comparisons, fit1 vs. fit2 and fit2 vs. fit3. So using an alpha of 0.05, the 0.99 p-value is comparing model 2 (fit2) and model 3 (fit1) and testing the null that they fit equally well with the differences being due to random chance. The p-value is

Re: [R] Reading large SAS dataset in R

2011-01-05 Thread Phil Spector
Santanu - If you have sas installed on your computer, you may find using the sas.get function of the Hmisc package useful. If the only message that read.ssd produced was Sas failed, it would be difficult to figure out what went wrong. Usually the location of the log file, which would

Re: [R] pattern recognition with paths

2011-01-05 Thread David Winsemius
On Jan 5, 2011, at 5:24 PM, Benjamin Polidore wrote: I'm trying to identify patterns among various paths like the following: http://i.imgur.com/bQPI3.png If I plot these, I can observe intuitively two different patterns: a front loaded (1 and 3) and a backloaded (2,4) progress path:

[R] categorize a character column

2011-01-05 Thread Tan, Richard
Hi, I know I can do this with a for loop with strsplit and grep, but is there more efficient way? Given a data dataframe (input) and a category column (lst), input item loc 1 item 1.1: earnings sep item 1.2: w2 sep shelf 1 2

[R] categorize a character column

2011-01-05 Thread Tan, Richard
Sorry I should have included the r code for the dataframes for ease of test: input - rbind(data.frame(item=item 1.1: earnings sep item 1.2: w2 sep, loc=shelf 1), data.frame(item=item 1.3: deductions sep, loc=drawer 1), data.frame(item=item 1.1: earnings sep, loc=shelf 2)) lst

Re: [R] Converting Fortran or C++ etc to R

2011-01-05 Thread David Duffy
Murray Jorgensen m...@stats.waikato.ac.nz wrote: I'm going to try my hand at converting some Fortran programs to R. Does anyone know of any good articles giving hints at such tasks? I will post a selective summary of my gleanings. Presuming you don't mean .Fortran(), I have gone both ways.

Re: [R] Converting Fortran or C++ etc to R

2011-01-05 Thread Peter Langfelder
On Tue, Jan 4, 2011 at 4:02 PM, Murray Jorgensen m...@stats.waikato.ac.nz wrote: I'm going to try my hand at converting some Fortran programs to R. Does anyone know of any good articles giving hints at such tasks? I will post a selective summary of my gleanings. If the code uses

Re: [R] convert expressions to characters

2011-01-05 Thread Yihui Xie
I see. Thanks! Regards, Yihui -- Yihui Xie xieyi...@gmail.com Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ames, IA On Wed, Jan 5, 2011 at 4:10 PM, Duncan Murdoch murdoch.dun...@gmail.com wrote: On 11-01-05 4:47 PM, Yihui Xie

Re: [R] pattern recognition with paths

2011-01-05 Thread Charles C. Berry
On Wed, 5 Jan 2011, Benjamin Polidore wrote: I'm trying to identify patterns among various paths like the following: http://i.imgur.com/bQPI3.png If I plot these, I can observe intuitively two different patterns: a front loaded (1 and 3) and a backloaded (2,4) progress path:

[R] memisc-Tables with robost standard errors

2011-01-05 Thread Jan Henckens
Hello, I've got a question concerning the usage of robust standard errors in regression using lm() and exporting the summaries to LaTeX using the memisc-packages function mtable(): Is there any possibility to use robust errors which are obtained by vcovHC() when generating the LateX-output

Re: [R] OT: Reducing pdf file size

2011-01-05 Thread Andrew Miles
I assume you mean PDFs generated by R. This topic has been addressed here: http://tolstoy.newcastle.edu.au/R/e2/help/07/05/17475.html I have always just output the graphics then used an external PDF program (like Preview on the Mac) to do changes in file type, size reductions, etc. Andrew

Re: [R] memisc-Tables with robost standard errors

2011-01-05 Thread Andrew Miles
I always use apsrtable in the apsrtable package, which allows you to specify a vcov matrix using the se option. The only trick is that you have to append it to your model object, something like this: fit=lm(y ~ x) fit$se=vcovHC(fit) apsrtable(fit, se=robust) Andrew Miles On Jan 5, 2011,

Re: [R] memisc-Tables with robost standard errors

2011-01-05 Thread Achim Zeileis
On Thu, 6 Jan 2011, Jan Henckens wrote: Hello, I've got a question concerning the usage of robust standard errors in regression using lm() and exporting the summaries to LaTeX using the memisc-packages function mtable(): Is there any possibility to use robust errors which are obtained by

[R] Cairo pdf canvas size

2011-01-05 Thread Eduardo de Oliveira Horta
Hello, I want to save a pdf plot using Cairo, but the canvas of the saved file seems too large when compared to the actual plotted area. Is there a way to control the relation between the canvas size and the size of actual plotting area? Thanks in advance, and best regards, Eduardo Horta

Re: [R] Cairo pdf canvas size

2011-01-05 Thread David Winsemius
On Jan 5, 2011, at 9:38 PM, Eduardo de Oliveira Horta wrote: Hello, I want to save a pdf plot using Cairo, but the canvas of the saved file seems too large when compared to the actual plotted area. Is there a way to control the relation between the canvas size and the size of actual

Re: [R] Cairo pdf canvas size

2011-01-05 Thread Eduardo de Oliveira Horta
Something like this: u=seq(from=-pi, to=pi, length=1000) f=sin(u) Cairo(example.pdf, type=pdf,width=12,height=12,units=cm,dpi=300) par(cex.axis=.6,col.axis=grey,ann=FALSE, lwd=.25,bty=n, las=1, tcl=-.2, mgp=c(3,.5,0)) xlim=c(-pi,pi) ylim=round(c(min(f),max(f)))

Re: [R] Cairo pdf canvas size

2011-01-05 Thread David Winsemius
On Jan 5, 2011, at 10:35 PM, Eduardo de Oliveira Horta wrote: Something like this: u=seq(from=-pi, to=pi, length=1000) f=sin(u) Cairo(example.pdf, type=pdf,width=12,height=12,units=cm,dpi=300) par(cex.axis=.6,col.axis=grey,ann=FALSE, lwd=.25,bty=n, las=1, tcl=-.2, mgp=c(3,.5,0))

Re: [R] Cairo pdf canvas size

2011-01-05 Thread Peter Langfelder
On Wed, Jan 5, 2011 at 7:35 PM, Eduardo de Oliveira Horta eduardo.oliveiraho...@gmail.com wrote: Something like this: u=seq(from=-pi, to=pi, length=1000) f=sin(u) Cairo(example.pdf, type=pdf,width=12,height=12,units=cm,dpi=300) par(cex.axis=.6,col.axis=grey,ann=FALSE, lwd=.25,bty=n, las=1,

<    1   2