[R] in par(mfrow=c(1, 2)), how to keep one half plot static and the other half changing

2012-11-27 Thread Baoqiang Cao
plot is overwritten by plot(dx,dy). Is there anyway to keep the left side intact while changing plots on the right side? Thanks a lot! Baoqiang __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the pos

[R] lm on matrix data

2012-10-10 Thread Baoqiang Cao
iny ~ trainx[,1] + trainx[,2] + .. +trainx[,220]. Any help, please? Best, Baoqiang __ R-help@r-project.org 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 prov

Re: [R] tm package: problem of TermDocumentMatrix and minWordLength

2012-05-16 Thread Baoqiang Cao
try this: dtm <- DocumentTermMatrix(examplecorpus, control = list(wordLengths=c(1,100))) On Wed, May 16, 2012 at 6:22 AM, C.H. wrote: > Dear All, > > The following code illustrate the problem. > > [R code] > require(tm) > exampledoc <- c("R is good", "R is really good") > examplecorpus <- Corp

Re: [R] help

2012-05-15 Thread Baoqiang
Package "mutoss" seems have Bonferroni correction. Sent from my iPhone On May 15, 2012, at 9:34 AM, 杨秀芬 wrote: > To whom this may concern, > > I have been learing R software. Recently when I did the analysis of the > associaiton of SNPs and disease, I have met one problem with Bonferroni > cor

Re: [R] file path

2012-05-14 Thread Baoqiang
This works on Mac: str <- "abc/d" gsub("/", "", str) Return: "abcd" Sent from my iPhone On May 14, 2012, at 4:28 AM, Wincent wrote: > Thanks for the suggestion. The file name in my case is Chinese, which > makes the regular expression less useful. > > Anyway, I would like to pose a followup

[R] error while install RCurl

2011-06-21 Thread Baoqiang Cao
011 month 04 day13 svn rev55427 language R version.string R version 2.13.0 (2011-04-13) Any help, please? Baoqiang __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the post

Re: [R] about spearman and kendal correlation coefficient calculation in "cor"

2011-05-16 Thread Baoqiang Cao
Thank you very much Thomas! I indeed learned a lot. Baoqiang On Tue, 2011-05-17 at 09:46 +1200, Thomas Lumley wrote: > } __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://ww

[R] about spearman and kendal correlation coefficient calculation in "cor"

2011-05-16 Thread Baoqiang Cao
accord=accord+1 } else if ((target[i] > target[j]) && (experi[i] > experi[j])) { disaccord=disaccord+1 } } } > (accord-disaccord)/(N*(N-1)/2) [1] -0.2181818 This is also different with from "cor", which is 0.183. Anybody could help me out explaining the right

[R] help on compare two ranks

2011-04-14 Thread Baoqiang Cao
wilcox.test but still a bit confused of how to compare the two ranking against the true ranking. Any advice will be highly appreciated. I apologize if this is a too statistics question. Thanks in advance. Baoqiang __ R-help@r-project.org mailing list

[R] use pcls to solve least square fitting with constraints

2010-12-06 Thread Baoqiang Cao
uldn't find any solution, any help and/or advice will be highly appreciated! Baoqiang __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html an

Re: [R] how to know if a file exists on a remote server?

2010-11-30 Thread Baoqiang Cao
o there is a lot of > checking to do > to make bullet proof code that downloads files. > > > > > > On Tue, Nov 30, 2010 at 3:16 PM, Baoqiang Cao wrote: >> >> Hi Georg, >> >> Your code does work, I mean, it doesn't give me any error message, >

Re: [R] how to know if a file exists on a remote server?

2010-11-30 Thread Baoqiang Cao
derfunction = h$update) h$value()[['status']] If the status is 404, then not found. If exists then status should be 200. " What a productive day! BC On Tue, Nov 30, 2010 at 1:34 PM, Georg Ruß wrote: > On 30/11/10 10:10:07, Baoqiang Cao wrote: >> I'd like to down

Re: [R] how to know if a file exists on a remote server?

2010-11-30 Thread Baoqiang Cao
ALSE, ftplistonly = TRUE, crlf = > TRUE) > filenames = paste(url, strsplit(filenames, "\r*\n")[[1]], sep = "") > con = getCurlHandle( ftp.use.epsv = FALSE) > contents = sapply(filenames[1:5], getURL, curl = con) > names(contents) = filenames[1:length(contents)] &g

Re: [R] how to know if a file exists on a remote server?

2010-11-30 Thread Baoqiang Cao
coerced into a data.frame that will look like a directory structure > listing the file names. > > If you need code just ask, but the RCurl docs are pretty good. > > > > On Tue, Nov 30, 2010 at 8:10 AM, Baoqiang Cao wrote: >> >> Hi, >> >> I'd l

[R] how to know if a file exists on a remote server?

2010-11-30 Thread Baoqiang Cao
Hi, I'd like to download some data files from a remote server, the problem here is that some of the files actually don't exist, which I don't know before try. Just wondering if a function in R could tell me if a file exists on a remote server? I searched this mailing list and after read severals m

[R] problem with catching error message in open function

2008-09-24 Thread Baoqiang Cao
he error from the "open" function? I'd like the program not being halted when the bad connection happens. Any help please? Best, Baoqiang __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read th

[R] function as.dist failed on large matrix on 64bit machine

2008-08-14 Thread Baoqiang Cao
o some clustering analysis. The machine is 2Gb memory 64bit Linux, and I also failed on a 16Gb memory 64bit Linux. Is there anyway that I can get around it? Or how large is the limitation on my machine? Thanks in advance. Best, Baoqiang __ R-