[R] showing ticks for censored data in survfit() in the rms package

2012-09-05 Thread Andrew Yee
The answer to this may be obvious, but I was wondering in the rms package and the survfit(), how you can plot the censored time points as ticks. Take for example, library(survival) library(rms) foo - data.frame(Time=c(1,2,3,4,5,6,10), Status=c(1,1,0,0,1,1,1)) answer - survfit(Surv(foo$Time,

Re: [R] how to handle no lines in input with pipe()

2011-04-12 Thread Andrew Yee
Thank you very much for your suggestion...that works perfectly. Thanks, Andrew On Mon, Apr 4, 2011 at 5:46 PM, Prof Brian Ripley rip...@stats.ox.ac.uk wrote: On Mon, 4 Apr 2011, Andrew Yee wrote: This has to do with using pipe() and grep and read.csv() I have a .csv file that I grep using

[R] how to handle no lines in input with pipe()

2011-04-04 Thread Andrew Yee
This has to do with using pipe() and grep and read.csv() I have a .csv file that I grep using pipe() and read.csv() as follows: read.csv(pipe('grep foo bar.csv')) However, is there a way to have this command run when for example, there is no foo text in the bar.csv file? I get an error message

Re: [R] trouble installing R-patched (R-2.12.0) when TMPDIR is specified

2010-10-18 Thread Andrew Yee
I'm mortified to report that the location I set in TMPDIR was not a valid directory in the system I was using (I copied it from another system), so this is a mea culpa on my part! Andrew On Mon, Oct 18, 2010 at 7:46 AM, Prof Brian Ripley rip...@stats.ox.ac.uk wrote: On Sun, 17 Oct 2010, Andrew

[R] trouble installing R-patched (R-2.12.0) when TMPDIR is specified

2010-10-17 Thread Andrew Yee
I noticed that if I specify the location of TMPDIR in .bashrc as follows on a Linux 64 bit system: export TMPDIR=/store/home/ayee/.tmp I get the following error message when installing R make[3]: Entering directory `/home/ayee/R-patched/src/library/base' building package 'base' make[4]:

[R] as.Date() add a day to a date

2010-09-13 Thread Andrew Yee
I'm trying to understand why as.Date() is converting a the modified date of a file from August 22 to August 23. foo - file.info(file.to.process) str(foo) 'data.frame': 1 obs. of 10 variables: $ size : num 5.37e+09 $ isdir : logi FALSE $ mode :Class 'octmode' int 436 $ mtime :

Re: [R] as.Date() add a day to a date

2010-09-13 Thread Andrew Yee
Thanks David, now I wonder how you can have as.Date() render the date using local time rather than UTC. Andrew On Mon, Sep 13, 2010 at 12:08 PM, David Winsemius dwinsem...@comcast.netwrote: On Sep 13, 2010, at 11:56 AM, Andrew Yee wrote: I'm trying to understand why as.Date() is converting

Re: [R] as.Date() add a day to a date

2010-09-13 Thread Andrew Yee
Dallazuanna www...@gmail.comwrote: Try this: format(dt, '%Y-%m-%d'), if you want Date class: as.Date(format(dt, '%Y-%m-%d')) On Mon, Sep 13, 2010 at 2:24 PM, Andrew Yee y...@post.harvard.edu wrote: Thanks David, now I wonder how you can have as.Date() render the date using local time

[R] using as.numeric() without generating warning message

2010-04-09 Thread Andrew Yee
I'm interested in testing whether or not a character string is numeric or not as follows: is.na(as.numeric('3')) # returns F is.na(as.numeric('A')) # I'd like this to return T without issuing a warning about NAs introduced by coercion. I guess you could suppress the warning with

Re: [R] using as.numeric() without generating warning message

2010-04-09 Thread Andrew Yee
Thanks for the tip! Andrew On Fri, Apr 9, 2010 at 8:04 PM, Gabor Grothendieck ggrothendi...@gmail.comwrote: Try this: suppressWarnings(as.numeric(A)) On Fri, Apr 9, 2010 at 7:22 PM, Andrew Yee y...@post.harvard.edu wrote: I'm interested in testing whether or not a character string

[R] specifying header in sqldf() and RSQLite

2010-04-06 Thread Andrew Yee
I have a file that I'm planning on manipulating with sqldf(). The header for this file is malformed, and I was wondering if there's a way to specify the values of the header ahead of time. I can see there are T/F options for header in sqldf(... list(header=T, ...), but was wondering if there's a

Re: [R] converting multiple lines of text to a data frame

2010-03-06 Thread Andrew Yee
                                        spec...@stat.berkeley.edu On Fri, 5 Mar 2010, Andrew Yee wrote: I'm trying to find a way for converting multiple lines of text into a table.  I'm not sure if there's a way where you can use read.delim() to read in multiple lines of text and create the following data frame with something

[R] converting multiple lines of text to a data frame

2010-03-05 Thread Andrew Yee
I'm trying to find a way for converting multiple lines of text into a table.  I'm not sure if there's a way where you can use read.delim() to read in multiple lines of text and create the following data frame with something akin to rehape()?. Apologies if there is an obvious way to do this. A: 1

Re: [R] tiff() and antialias option

2010-02-22 Thread Andrew Yee
Uwe, you're right, it turns out that cairo hadn't been previously installed on the system. Andrew 2010/2/19 Uwe Ligges lig...@statistik.tu-dortmund.de On 19.02.2010 17:44, Andrew Yee wrote: I was wondering if someone could help with the antialias option in tiff(). I'm running R 2.9.2

[R] tiff() and antialias option

2010-02-19 Thread Andrew Yee
I was wondering if someone could help with the antialias option in tiff(). I'm running R 2.9.2 on a Linux machine. I'm working on creating a tiff file and have tried different antialias parameters, e.g. default, none, gray, and subpixel, but don't seem to be seeing a difference in the output.

[R] pdf() and pagecentre option

2009-12-22 Thread Andrew Yee
Hi, I was wondering how you can create a pdf where the output is vertically justified with for example a one inch margin on top using pdf(). For example in pdf(file='test.pdf', paper='letter', pagecentre=F) ### code for plot ### dev.off() is there an option where it generate output that starts

[R] how do you know which functions are being debugged?

2009-10-23 Thread Andrew Yee
This is kind of a dumb question: I know you can use isdebugged() to find out if a specific function is flagged for debugging, but is there a way to list all the functions that are flagged for debugging? Thanks, Andrew [[alternative HTML version deleted]]

Re: [R] how do you know which functions are being debugged?

2009-10-23 Thread Andrew Yee
, Iowa State University 3211 Snedecor Hall, Ames, IA On Fri, Oct 23, 2009 at 1:02 PM, Duncan Murdoch murd...@stats.uwo.ca wrote: On 10/23/2009 1:28 PM, Andrew Yee wrote: This is kind of a dumb question: I know you can use isdebugged() to find out if a specific function is flagged

[R] converting matrix of lists to a regular matrix

2009-10-03 Thread Andrew Yee
Take the following code: foo - list() foo[[1]] - list(a=1, b=2) foo[[2]] - list(a=11, b=22) foo[[3]] - list(a=111, b=222) result - do.call(rbind, foo) result[,'a'] In this case, result[,'a'] shows a list. Is there a more elegant way such that result is a regular matrix of vectors? I imagine

Re: [R] converting matrix of lists to a regular matrix

2009-10-03 Thread Andrew Yee
ggrothendi...@gmail.comwrote: Try this: matrix(list(1, 11, 111, 2, 22, 222), nc = 2, dimnames = list(NULL, c(a, b))) or out - list(1, 11, 111, 2, 22, 222) dim(out) - c(3, 2) colnames(out) - c(a, b) On Sat, Oct 3, 2009 at 7:51 PM, Andrew Yee y...@post.harvard.edu wrote: Take the following

Re: [R] converting matrix of lists to a regular matrix

2009-10-03 Thread Andrew Yee
Thanks, as you suggested, do.call(rbind, lapply(foo, unlist)) does the trick. On Sat, Oct 3, 2009 at 8:30 PM, David Winsemius dwinsem...@comcast.netwrote: On Oct 3, 2009, at 7:51 PM, Andrew Yee wrote: Take the following code: foo - list() foo[[1]] - list(a=1, b=2) foo[[2]] - list(a=11

[R] treating a data symbol like a character

2009-07-09 Thread Andrew Yee
Hi, is there a way to treat a data symbol, e.g. one with pch = 16, as a character? Specifically, I'm interested in creating a line of text as follows using the text() function O alpha O beta O gamma where the O is pch 16 and filled with a specific color. Not sure if this is possible or not.

Re: [R] treating a data symbol like a character

2009-07-09 Thread Andrew Yee
?text, ?expression and ?legend for more information. HTH, Jorge On Thu, Jul 9, 2009 at 10:53 AM, Andrew Yee y...@post.harvard.edu wrote: Hi, is there a way to treat a data symbol, e.g. one with pch = 16, as a character? Specifically, I'm interested in creating a line of text as follows

Re: [R] treating a data symbol like a character

2009-07-09 Thread Andrew Yee
plot(x, pch = PCH) legend('topright', pch = PCH, Text, ncol = 3) should be close to what you want. Note that the text() / points() combination could be avoided when using legend(). Best, Jorge On Thu, Jul 9, 2009 at 11:08 AM, Andrew Yee wrote: Thanks for your help. I should have

Re: [R] what happened to the xlsReadWrite package

2009-06-26 Thread Andrew Yee
...@stats.ox.ac.ukwrote: On Fri, 26 Jun 2009, David Scott wrote: Andrew Yee wrote: A naive question: what happened to the xlsReadWrite package? http://cran.r-project.org/web/packages/xlsReadWrite/ It says that it was removed from the CRAN repository. Note that it was archived, not removed entirely

[R] what happened to the xlsReadWrite package

2009-06-25 Thread Andrew Yee
A naive question: what happened to the xlsReadWrite package? http://cran.r-project.org/web/packages/xlsReadWrite/ It says that it was removed from the CRAN repository. Are there any plans for it be available again? Thanks, Andrew [[alternative HTML version deleted]]

[R] stripchart and ordering of plot

2009-05-22 Thread Andrew Yee
Take for example the following stripchart that's created: b - 1:5 a - 11:15 e - 21:25 f - -11:-15 foo - rbind(b,a,e,f) stripchart(foo ~ rownames(foo)) In this case, I would like the bottom part of the plot to be the f vector, followed by the e vector, etc. However, R reorders the matrix and

Re: [R] stripchart and ordering of plot

2009-05-22 Thread Andrew Yee
Thanks, that works great. Andrew On Fri, May 22, 2009 at 5:42 PM, William Dunlap wdun...@tibco.com wrote: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Andrew Yee Sent: Friday, May 22, 2009 2:16 PM To: r-h

[R] segfault when running heatmap()

2009-03-24 Thread Andrew Yee
Hi, I was wondering if someone in the mailing list has any insight into this segfault error that I consistently find when running a script containing heatmap() in R 2.8.1 and 2.8.0 on a Linux 64-bit machine. Some points: 1. This occurs when running heatmap(). 2. Interestingly, if I source() the

[R] testing for bimodal distribution

2009-02-03 Thread Andrew Yee
I'm not sure where to begin with this, but I was wondering if someone could refer me to an R package that would test to see if a distribution fits a bimodal distribution better than a unimodal distribution. Thanks, Andrew [[alternative HTML version deleted]]

Re: [R] with lapply() how can you retrieve the name of the object

2008-07-21 Thread Andrew Yee
) res=do.call(rbind,test.list) res$var.2=substr(rownames(res),1,1) rownames(res)=NULL res HTH, Jorge On Fri, Jul 18, 2008 at 6:21 PM, Andrew Yee [EMAIL PROTECTED] wrote: In the following code, I'd like to be able to create a new variable containing the value of the names

[R] with lapply() how can you retrieve the name of the object

2008-07-18 Thread Andrew Yee
In the following code, I'd like to be able to create a new variable containing the value of the names of the list. a - data.frame(var.1 = 1:5) b - data.frame(var.1 = 11:15) test.list - list(a=a, b=b) # in this case, names(test.list) is a and b # and I'd like to use lapply() so that # I get

[R] keeping original order in factor()

2008-06-17 Thread Andrew Yee
Apologies for the naieveness of this question, but I'm having trouble figuring out to have factor() maintain original ordering. For example, foo - c(b,b,a,a) levels(factor(foo, ordered=T)) #I'd like this to return as b a #not a b I thought having

[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] 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

[R] controlling location of labels in axis()

2008-06-12 Thread Andrew Yee
Here's a naive question about axis() How do you control the location of the labels with the axis() command? In the following example: foo - data.frame(plot.x=seq(1:3), plot.y=seq(4:6)) plot(foo$plot.x, foo$plot.y, type='n', axes=FALSE) points(foo$plot.x, foo$plot.y) axis(1, at=foo$plot.x,

Re: [R] controlling location of labels in axis()

2008-06-12 Thread Andrew Yee
outer x axis label,side=3,outer=TRUE) mtext(Second outer y axis label,side=4,outer=TRUE) Cheers, Toby Marthews Le Jeu 12 juin 2008 15:32, Andrew Yee a écrit : Here's a naive question about axis() How do you control the location of the labels with the axis() command? In the following

[R] alternatives to RColorBrewer?

2008-04-24 Thread Andrew Yee
I've found RColorBrewer useful for its qualitative palettes, but wished that it could generate more than 12 qualitative palettes (e.g. with Set3). Any suggestions for alternative color palette generators that can handle e.g. 18 distinctive colors? (I'm aware of using rainbow(), but this doesn't

Re: [R] alternatives to RColorBrewer?

2008-04-24 Thread Andrew Yee
Great, thanks, that was helpful. Andrew On Thu, Apr 24, 2008 at 2:15 PM, Achim Zeileis [EMAIL PROTECTED] wrote: On Thu, 24 Apr 2008, Andrew Yee wrote: I've found RColorBrewer useful for its qualitative palettes, but wished that it could generate more than 12 qualitative palettes (e.g

Re: [R] why is text being rasterized with text()

2008-04-03 Thread Andrew Yee
-- the antialiasing isn't working for you. On Thu, 3 Apr 2008, Andrew Yee wrote: Here's a question: I noticed that when I tried to create this simple graph of rectangles and text, R appears to generate text that is rasterized (this is seen both on the monitor and when the output

[R] why is text being rasterized with text()

2008-04-02 Thread Andrew Yee
Here's a question: I noticed that when I tried to create this simple graph of rectangles and text, R appears to generate text that is rasterized (this is seen both on the monitor and when the output is directed to a pdf file). Any thoughts? value.seq - c(4,as.character(seq(from=4,to=10)),11)

[R] changing color scheme in R in UNIX

2008-01-20 Thread Andrew Yee
Hi, I've been using R in Windows but am now starting to use it more often in the UNIX environment. In Windows, I'm used to the text provided by the user appearing in red, and the output from R appearing in blue. Is there a way to achieve this in UNIX? Thanks, Andrew [[alternative HTML