Re: [R] 'matplot' for matrix with NAs: broken lines

2010-05-06 Thread Tao Shi
pe="b", cex = 2, pch = 16) > > This way, it will be easier to spot where data values are missing. > > HTH, > Dennis > > On Thu, May 6, 2010 at 10:44 AM, Tao Shi> wrote: > > > > I just found out that my "does this by default" statement (by which

Re: [R] 'matplot' for matrix with NAs: broken lines

2010-05-06 Thread Tao Shi
can do this.  Now, I guess not. ...Tao > From: maech...@stat.math.ethz.ch > Date: Thu, 6 May 2010 18:34:22 +0200 > To: shi...@hotmail.com > CC: ggrothendi...@gmail.com; r-help@r-project.org > Subject: Re: [R] 'matplot' for matri

Re: [R] 'matplot' for matrix with NAs: broken lines

2010-05-05 Thread Tao Shi
rg > > Try this: > > library(zoo) > matplot(na.approx(b), type = "l") > > On Wed, May 5, 2010 at 2:30 PM, Tao Shi wrote: >> >> Hi list, >> >> I know that points involving NAs are not plotted in 'matplot', but when I >> pl

[R] What is the best way to have "R" output tables in an MS Word format?

2010-05-05 Thread Tao Shi
Hi Max, It looks like most of answers were towards to the statisticians you work with (i.e. R -> Word).  For yourself, if you just worry about converting the PDF reports from your statisticians to Word, here is another link with a more comprehensive review besides the two online apps Prof. Ha

Re: [R] Read data from .csv file as a matrix

2010-05-05 Thread Tao Shi
Vincent, The root of this problem seems to be that you don't fully understand the differences between matrix and data.frame.  Read up on them and you'll know how to solve this problem. For now: as.matrix(temp[,-1]) or temp = read.csv("Weather.csv", sep=",", row.names=1) temp1 <- as.matrix(t

[R] 'matplot' for matrix with NAs: broken lines

2010-05-05 Thread Tao Shi
Hi list, I know that points involving NAs are not plotted in 'matplot', but when I plot them as lines, I still want the lines to connect all the points (i.e. not broken where there are NAs).  Please see the example below.  How can I achieve this in 'matplot'?  If I can't, any good alternatives

[R] apply vs. foreach vs. foreach with doSMP (multi cores)

2010-04-29 Thread Tao Shi
Hi David and list, I'm a little puzzled to see these results below.  Since, "apply" is basically a for loop, I was expecting "foreach" uses about same amount of time as apply, whereas foreach after registering 2-cores runs much faster.  However, the results show apply is the fastest.  Also

Re: [R] Can't load "doSMP" from REvolutionR in regular R2.11.0

2010-04-29 Thread Tao Shi
download the source bundle when you downloaded REvolution R? > You'll find them there. There's a link in the same email that gives > instructions for downloading the binaries. > > # David Smith > > On Thu, Apr 29, 2010 at 12:48 PM, Tao Shi wrote: >> >> Hi D

Re: [R] Can't load "doSMP" from REvolutionR in regular R2.11.0

2010-04-29 Thread Tao Shi
we use for REvolution R. It is open source (GPL) so > you're welcome to try compiling it under mingw yourself, but we can't > offer support for that configuration. > > # David Smith > > On Wed, Apr 28, 2010 at 5:10 PM, Tao Shi wrote: >> I was testing out the

[R] Can't load "doSMP" from REvolutionR in regular R2.11.0

2010-04-28 Thread Tao Shi
Hi list, I was testing out the "doSMP" package from REvolutionR in my regular R2.11.0 installation and I got the following error message.  Well, one obvious thing is that R2.11.0 was built using "i386-pc-mingw32" which is different from what revoIPC used.  I could just use REvolutionR, but all

[R] a warning message from "heatmap.2"

2010-04-05 Thread Tao Shi
Hi List, I want to show the heatmap of a correlation matrix using "heatmap.2", however always get this warning message (see below) and the column dendrogram is not showing.  It's not really a big deal, but curious how to suppress it and still let R show what I want to show (i.e. a symmetrical

Re: [R] lineplot.CI in "sciplot": option "ci.fun" can't be changed?

2010-04-02 Thread Tao Shi
ata, fun=median) #works > ex.fn(data, fun2=function(x) fun(x)+3) #error with fun(x) not found > > > On Fri, 2010-04-02 at 17:36 +, Tao Shi wrote: >> hi List and Manuel, >> >> I have encounter the following problem with the function "lineplot.CI&qu

[R] lineplot.CI in "sciplot": option "ci.fun" can't be changed?

2010-04-02 Thread Tao Shi
hi List and Manuel, I have encounter the following problem with the function "lineplot.CI".  I'm running R 2.10.1, sciplot 1.0-7 on Win XP.  It seems like it's a scoping issue, but I couldn't figure it out. Thanks! ...Tao > lineplot.CI(x.factor = dose, response = len, data = ToothGrowth)  

Re: [R] wrap long lines in table using "latex" in Hmisc

2010-03-01 Thread Tao Shi
Thank you guys for the wonderful suggestions! Charlie, You obviously foresaw my problem!   It took me a while to figure out that the \raggedright and other justification commands should be applied to each cell.  It didn't work for me when applied to the headings.  See this nice document here:

Re: [R] wrap long lines in table using "latex" in Hmisc

2010-02-26 Thread Tao Shi
at, col.just = rep("p{1in}", 2)) > > You can also set justification for column headings, column group > headings etc. See ?latex for details. > > Best, > Ista > > > On Fri, Feb 26, 2010 at 3:37 PM, Tao Shi wrote: >> >> Hi list, >> >> Is

Re: [R] text editors

2010-02-26 Thread Tao Shi
If you do everything in Windows, Tinn-R is one of the best and also the one I use.  I also tried WinEdt. It's very good, but it is not free.  If you want a cross-platform editor, Emacs+ESS is the one.  Like others said, the learning curve is steep, but worth it. ...Tao ===

[R] wrap long lines in table using "latex" in Hmisc

2010-02-26 Thread Tao Shi
Hi list, Is there a way to control long-line wrapping in a table using "latex" function in Hmisc or any other functions?  It seems I can't find any examples. Thank you very much! ...Tao

[R] a minor bug in "venn" from gplots?

2009-10-29 Thread Tao Shi
Hi list, I found this one when I was trying to output the Venn diagram to a .pdf file.  When there are 4 sets of groups to draw, the .pdf file automatically has 3 pages and the figure only appears on the 3rd page in the .pdf file with the first 2 pages being blank.  Try the following: (I'm us

Re: [R] SVM cross validation in e1071

2009-07-07 Thread Tao Shi
o: shi...@hotmail.com > Subject: Re: [R] SVM cross validation in e1071 > Date: Tue, 7 Jul 2009 21:43:49 -0400 > > Hi Tao, > > On Jul 7, 2009, at 8:33 PM, Tao Shi wrote: > >> Hi list, >> >> Could someone help me to explain why the leave-one-out cross >

[R] SVM cross validation in e1071

2009-07-07 Thread Tao Shi
Hi list, Could someone help me to explain why the leave-one-out cross validation results I got from svm using the internal option "cross" are different from those I got manually? It seems using "cross" to do cross validation, the results are always better. Please see the code below. I also

Re: [R] silhouette: clustering labels have to be consecutive integers starting

2009-05-13 Thread Tao Shi
to be consecutive > integers starting > > >>>>> "TS" == Tao Shi > >>>>> on Wed, 10 Oct 2007 06:15:53 + writes: > > TS> Thank you very much, Benilton and Prof. Ripley, for the > TS> speedy replies! > >

[R] why two diff. se in nlsList?

2009-01-26 Thread Tao Shi
Hi list, In the object returned by summary.nlsList, what's the difference between "coefficients" and "parameters"? The have the same "Estimate", different se (therefore t value), but same p values. R.2.8.0 on winxp with nlme_3.1-89 Thanks, ...Tao +++

[R] "latex" in Hmisc: cell formating

2009-01-23 Thread Tao Shi
problem persisted. ...Tao Tao Shi hotmail.com> writes: > ## I'm using R 2.8.0 on WinXP, Hmisc_3.4-3 > >> table1 <- matrix(10, 180,7) >> cell.format <- matrix("", ncol=7, nrow=180) >> cell.format[c(seq(3,180,6),seq(4,180,6)),] <- &qu

[R] "latex" in Hmisc: cell formating

2009-01-22 Thread Tao Shi
Hi list, Could you explain the error I see here? Thanks! ## I'm using R 2.8.0 on WinXP, Hmisc_3.4-3 > table1 <- matrix(10, 180,7) > cell.format <- matrix("", ncol=7, nrow=180) > cell.format[c(seq(3,180,6),seq(4,180,6)),] <- "color{red}" > cell.format[c(seq(5,180,6),seq(6,180,6)),] <- "color{gr

[R] follow up on "[Rd] NAMESPACE & methods guidance, please" ( http://tolstoy.newcastle.edu.au/R/e4/devel/08/06/1901.html )

2008-10-07 Thread Tao Shi
This is a follow-up on the discussion originally posted on the R-devel list ( http://tolstoy.newcastle.edu.au/R/e4/devel/08/06/1901.html ), as I have encountered the exact same issue mentioned in Martin's email. Here is a simplified version of my problem: ##=

Re: [R] a question regarding package building

2008-06-26 Thread Tao Shi
Got it! Thank you very much! ...Tao > Date: Thu, 26 Jun 2008 20:41:29 +0200 > From: [EMAIL PROTECTED] > To: [EMAIL PROTECTED] > CC: r-help@r-project.org > Subject: Re: [R] a question regarding package building > > > >

[R] a question regarding package building

2008-06-26 Thread Tao Shi
Hi List, In Windows, if I do " R CMD build mypkg", then I'll get 'mypkg_1.0.tar.gz'. Any option in R CMD build lets me to change the version, i.e. gives me 'mypkg_2.0.tar.gz"? It seems "-version" option doesn't do anything for me. Is it OK if I just change the version number in the file nam

[R] nlme model specification (revisit)

2008-01-11 Thread Tao Shi
Hi List, While using 'nlme' function, I have encountered the similar problem Dr. Stevens and Dr. Graves observed (please see the posts: https://stat.ethz.ch/pipermail/r-help/2006-May/105832.html ). I have tried Dr. Stevens's original example, the problem is still there, > mod.lis <- nlsList

[R] updating a helper function in a R package

2007-12-06 Thread Tao Shi
Hi list, Sorry for the vague title, but here is the scenario. I’m writing an R package, let’s say, ‘pkg1’, which contains 3 functions: f1, f2, f3. f2 and f3 are helper functions for f1, i.e. f1 calls f2 which in turn calls f3. f1 <- function(…) { …. f2() … } f2 <-

[R] RMySQL installation problem

2007-11-15 Thread Tao Shi
Hi List, I'm running R2.5.1 on WinXP. Downloaded RMySQL_0.6-0.zip from http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/2.6/ and the installation seemed fine. However, when I tried to load the package, the error occured: > utils:::menuInstallLocal() package 'RMySQL' successfully unpa

Re: [R] silhouette: clustering labels have to be consecutive intergers starting

2007-10-09 Thread Tao Shi
Thank you very much, Benilton and Prof. Ripley, for the speedy replies! Looking forward to the fix! Tao >From: Prof Brian Ripley <[EMAIL PROTECTED]> >To: Benilton Carvalho <[EMAIL PROTECTED]> >CC: Tao Shi <[EMAIL PROTECTED]>, [EMAIL PROTECTED], >r-h

[R] silhouette: clustering labels have to be consecutive intergers starting from 1?

2007-10-09 Thread Tao Shi
Hi list, When I was using 'silhouette' from the 'cluster' package to calculate clustering performances, R crashed. I traced the problem to the fact that my clustering labels only have 2's and 3's. when I replaced them with 1's and 2's, the problem was solved. Is the function purposely writt