[R] Pathview xml issue
Hi, I'm using GAGE/pathview to analyze my RNA-seq and phospho-protein data. The following error occurs after this command line below: >pv.out.list <- sapply(path.ids2[1:3], function(pid) pathview( gene.data = cnts.d, pathway.id = pid, gene.idtype="SYMBOL",kegg.native = F, same.layer = T, species = "hsa", kegg.dir = "test", out.suffix = "up")) Start tag expected, '<' not found Warning: Parsing test/hsa04510.xml file failed, please check the file! That .xml file is empty, while .png file exists. The issue is there is no pathway with my data mapped (red and blue nodes). Can you please help that? Thank you! Best, Shu [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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] Fwd: only plot borders of a region in a scatter plot
Dear William, Duncan and Bert, Thanks a lot for your help and tips :D In fact the contour() plot still cannot solve my problem perfectly. As the resolution of my plot is very coarse, I want to a contour perfectly surround all grid cells in the river basin. In another word, I want all angle of the contour to be 90 degree. Another problem for the contour() is that the contour line doesn't close at where the value of neighbouring grid cell is NA. See the right side of the two contour lines (attachment). Do you know how I can get what I want? Thanks a lot :P Cheers, Zun Yin On Thu, Aug 4, 2016 at 5:09 PM, Bert Gunter wrote: > ... note the typo. It's: > > contour( basiinID == ID, level=0.5) > > :-) > > > -- Bert > > > > Bert Gunter > > "The trouble with having an open mind is that people keep coming along > and sticking things into it." > -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) > > > On Thu, Aug 4, 2016 at 8:03 AM, William Dunlap via R-help > wrote: > > If 'basinID' is the matrix of basin identifiers you could draw an outline > > of the basin with identifier 'ID' with > >coutour( basiinID == ID, level=0.5) > > Add 'add=TRUE' if you are overlaying this on an existing plot. > > > > Bill Dunlap > > TIBCO Software > > wdunlap tibco.com > > > > On Thu, Aug 4, 2016 at 1:51 AM, Zun Yin wrote: > > > >> D > >> ear all, > >> > >> I have a matrix with ID of river basins (integer numbers). Now I want to > >> highlight one river basin in a map by plotting only the border. Like the > >> attached figure. Two river basins are highlighted by polygons. It is > >> created by ferret, but I prefer to implement it by R. Anybody know how > to > >> do it? Thanks a lot. > >> > >> Cheers, > >> > >> Zun Yin > >> > >> __ > >> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > >> 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. > >> > > > > [[alternative HTML version deleted]] > > > > __ > > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > > 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. > basin.pdf Description: Adobe PDF document __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.
[R] User defined function within a formula
Hello, I have a question about the formula and the user defined function: I can do following: ###Case 1: > clotting <- data.frame( + u = c(5,10,15,20,30,40,60,80,100), + lot1 = c(118,58,42,35,27,25,21,19,18), + lot2 = c(69,35,26,21,18,16,13,12,12)) > g1=glm(lot1 ~ log(u) + poly(u,1), data = clotting, family = Gamma) > dc=clotting > dc$u=1 > predict(g1,dc) 1 2 3 4 5 6 7 8 9 -0.01398929 -0.01398929 -0.01398929 -0.01398929 -0.01398929 -0.01398929 -0.01398929 -0.01398929 -0.01398929 However, if I just simply wrap the poly as a user defined function ( in reality I would have my own more complex function) then I will get error: ###Case 2: > xpoly<-function(x,degree=1){poly(x,degree)} > g2=glm(lot1 ~ log(u) + xpoly(u,1), data = clotting, family = Gamma) > predict(g2,dc) Error in poly(x, degree) : 'degree' must be less than number of unique points It seems that the predict always treat the user defined function in the formula with I(). My question is how can I get the results for Case2 same as case1? Anyone can have any idea about this? Thank you very much. Alex [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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] User defined function within a formula
Thanks Bill for your quick reply. I tried your solution and it did work for the simple user defined function xploly. But when I try with other function, it gave me error again: OPoly<-function(x,degree=1,weight=1){ weight=round(weight,0)# weight need to be integer if(length(weight)!=length(x))weight=rep(1,length(x)) p=poly(4*(rep(x,weight)-mean(range(x)))/diff(range(x)),degree) Z<-(t(t(p[cumsum(weight),])*sqrt(attr(p,"coefs")$norm2[-seq(2)]))[,degree]) class(Z)<-"OPoly";Z } ##this OPoly is an FORTRAN orthogonal polynomial routine, it first maps the x to range[-2,2] then do QR, then return the results with sqrt(norm2). Comparing with poly, this transformation will make the model coefficients within a similar range as other variables, the R poly routine will usually give you a very large coefficients. I did not find such routine in R, so I have to define this as user defined function. ### I also have following function as you suggested: makepredictcall.OPoly<-function(var,call) { if (is.call(call)) { if (identical(call[[1]], quote(OPoly))) { if (!is.null(tmp <- attr(var, "coefs"))) { call$coefs <- tmp } } } call } But I still got error for following: > g3=glm(lot1 ~ log(u) + OPoly(u,1), data = clotting, family = Gamma) > predict(g3,dc)Error in poly(4 * (rep(x, weight) - > mean(range(x)))/diff(range(x)), degree) : missing values are not allowed in 'poly' I thought it might be due to the /diff(range(x) in the function. But even I remove that part, it will still give me error. Any idea? Many thanks in advance. Alex On Thu, Jul 16, 2015 at 2:09 PM, William Dunlap wrote: > Read about the 'makepredictcall' generic function. There is a method, > makepredictcall.poly(), for poly() that attaches the polynomial > coefficients > used during the fitting procedure to the call to poly() that predict() > makes. > You ought to supply a similar method for your xpoly(), and xpoly() needs > to return an object of a a new class that will cause that method to be used. > > E.g., > > xpoly <- function(x,degree=1,...){ ret <- poly(x,degree=degree,...); > class(ret) <- "xpoly" ; ret } > makepredictcall.xpoly <- function (var, call) > { > if (is.call(call)) { > if (identical(call[[1]], quote(xpoly))) { > if (!is.null(tmp <- attr(var, "coefs"))) { > call$coefs <- tmp > } > } > } > call > } > > g2 <- glm(lot1 ~ log(u) + xpoly(u,1), data = clotting, family = Gamma) > predict(g2,dc) > # 1 2 3 4 > 5 > #-0.01398928608 -0.01398928608 -0.01398928608 -0.01398928608 > #-0.01398928608 > # 6 7 8 9 > #-0.01398928608 -0.01398928608 -0.01398928608 -0.01398928608 > > You can see the effects of makepredictcall() in the 'terms' component > of glm's output. The 'variables' attribute of it gives the original > function > calls and the 'predvars' attribute gives the calls to be used for > prediction: >> attr(g2$terms, "variables") >list(lot1, log(u), xpoly(u, 1)) > > attr(g2$terms, "predvars") > list(lot1, log(u), xpoly(u, 1, coefs = list(alpha = 40, norm2 = c(1, > 9, 8850 > > > > Bill Dunlap > TIBCO Software > wdunlap tibco.com > > On Thu, Jul 16, 2015 at 12:35 PM, Kunshan Yin > wrote: > >> Hello, I have a question about the formula and the user defined function: >> >> I can do following: >> ###Case 1: >> > clotting <- data.frame( >> + u = c(5,10,15,20,30,40,60,80,100), >> + lot1 = c(118,58,42,35,27,25,21,19,18), >> + lot2 = c(69,35,26,21,18,16,13,12,12)) >> > g1=glm(lot1 ~ log(u) + poly(u,1), data = clotting, family = Gamma) >> > dc=clotting >> > dc$u=1 >> > predict(g1,dc) >> 1 2 3 4 5 >> 6 7 8 9 >> -0.01398929 -0.01398929 -0.01398929 -0.01398929 -0.01398929 -0.01398929 >> -0.01398929 -0.01398929 -0.01398929 >> >> However, if I just simply wrap the poly as a user defined function ( in >> reality I would have my own more complex function) then I will get error: >> ###Case 2: >> > xpoly<-function(x,degree=1){poly(x,degree)} >> > g2=glm(lot1 ~ log(u) + xpoly(u,1), data = clotting, family = Gamma) >> > predict(g2,dc) >> Error in poly(x, degree) : >> 'degree' must be less than number of unique points >> >> It seems that the predict always treat the user def
Re: [R] User defined function within a formula
Thank you very much. It worked. I think I need to digest this further later. Thanks again for the help. On Thu, Jul 16, 2015 at 4:51 PM, William Dunlap wrote: > This might do what you want: > > OPoly <- function(x, degree=1, weight=1, coefs=NULL, rangeX=NULL){ > weight <- round(weight,0)# weight need to be integer > if(length(weight)!=length(x)) { > weight <- rep(1,length(x)) > } > if (is.null(rangeX)) { > rangeX <- range(x) > } > p <- poly(4*(rep(x,weight)-mean(rangeX))/diff(rangeX), degree=degree, > coefs=coefs) > # why t(t(...))? That strips the attributes. > Z <- t( t(p[cumsum(weight),]) * sqrt(attr(p,"coefs")$norm2[-seq(2)]) )[, > degree, drop=FALSE] > class(Z) <- "OPoly" > attr(Z, "coefs") <- attr(p, "coefs") > attr(Z, "rangeX") <- rangeX > Z > } > > makepredictcall.OPoly<-function(var,call) > { > if (is.call(call)) { > if (identical(call[[1]], quote(OPoly))) { > if (!is.null(tmp <- attr(var, "coefs"))) { > call$coefs <- tmp > } > if (!is.null(tmp <- attr(var, "rangeX"))) { > call$rangeX <- tmp > } > call$weight <- 1 # weight not relevant in predictions > } > } > call > } > > d <- data.frame(Y=1:8, X=log(1:8), Weight=1:8) > fit <- lm(data=d, Y ~ OPoly(X, degree=2, weight=Weight)) > predict(fit)[c(3,8)] > predict(fit, newdata=data.frame(X=d$X[c(3,8)])) # same result > > > Bill Dunlap > TIBCO Software > wdunlap tibco.com > > On Thu, Jul 16, 2015 at 4:39 PM, William Dunlap wrote: > >> OPoly<-function(x,degree=1,weight=1){ >> weight=round(weight,0)# weight need to be integer >> if(length(weight)!=length(x))weight=rep(1,length(x)) >> p=poly(4*(rep(x,weight)-mean(range(x)))/diff(range(x)),degree) >> Z<-(t(t(p[cumsum(weight),])*sqrt(attr(p,"coefs")$norm2[- >> seq(2)]))[,degree]) >> class(Z)<-"OPoly";Z >> } >> >> You need to make OPoly to have optional argument(s) that give >> the original-regressor-dependent information to OPoly and then >> have it return, as attributes, the value of those arguments. >> makepredictcall >> will take the attributes and attach them to the call in predvars so >> predict uses values derived from the original regressors, not value >> derived >> from the data to be predicted from. >> >> Take a look at a pair like makepredictcall.scale() and scale() for an >> example: >> scale has optional arguments 'center' and 'scale' that it returns as >> attributes >> and makepredictcall.scale adds those to the call to scale that it is >> given. >> Thus when you predict, the scale and center arguments come from the >> original data, not from the data you are predicting from. >> >> >> >> >> >> >> Bill Dunlap >> TIBCO Software >> wdunlap tibco.com >> >> On Thu, Jul 16, 2015 at 3:43 PM, Kunshan Yin >> wrote: >> >>> Thanks Bill for your quick reply. >>> >>> I tried your solution and it did work for the simple user defined >>> function xploly. But when I try with other function, it gave me error again: >>> >>> OPoly<-function(x,degree=1,weight=1){ >>> weight=round(weight,0)# weight need to be integer >>> if(length(weight)!=length(x))weight=rep(1,length(x)) >>> p=poly(4*(rep(x,weight)-mean(range(x)))/diff(range(x)),degree) >>> >>> Z<-(t(t(p[cumsum(weight),])*sqrt(attr(p,"coefs")$norm2[-seq(2)]))[,degree]) >>> class(Z)<-"OPoly";Z >>> } >>> >>> ##this OPoly is an FORTRAN orthogonal polynomial routine, it first maps >>> the x to range[-2,2] then do QR, then return the results with sqrt(norm2). >>> Comparing with poly, this transformation will make the model coefficients >>> within a similar range as other variables, the R poly routine will usually >>> give you a very large coefficients. I did not find such routine in R, so I >>> have to define this as user defined function. >>> ### >>> >>> I also have following function as you suggested: >>> >>> makepredictcall.OPoly<-function(var,call) >>> { >>> if (is.call(call)) { >>> if (identical(call[[1]], quote(OPoly))) { >>> if (!is.null(tmp <- attr(var, "coefs"))) { >>> call$coefs <- tmp >>> } >>> } >>> } >>> call >
[R] solve heywood case within R
Hello. Sorry to bother you, but this is the email address I got from r-help... I am wondering if R has some similar command like SAS to solve heywood cases. If there some related functions/program, would you give me some help on that? Thank you very much. With regards, Yin Chang __ 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 provide commented, minimal, self-contained, reproducible code.
[R] s4 class documentation in R
Hi All, I am currently trying to transform my package to s4 methods, I don't know if there is any package or easy way like Roxygen to document the S4 methods. I use emacs+ess+roxygen to document simple function and package before, I don't know if Roxygen support S4 method too. Any suggestions for me? Thanks Regards Tengfei -- Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 Homepage: www.tengfei.name English Blog: www.tengfei.name/en Chinese Blog: www.tengfei.name/ch [[alternative HTML version deleted]] __ 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 provide commented, minimal, self-contained, reproducible code.
[R] how to manipulate object in specific environment?
Hi I want to simplify my problem into a prototype, how to write a function to get all the object in your current environment, e.g. .GlobalEnv, and print their mode? For example, if I have object a,b,c... in my environment, a=1;b='test';c=matrix(0,3,3). I want to write a function myfun(), when I run myfun(), this retrieve all the objects in my environment automatically and print their mode or class one by one. Thanks Regards Tengfei -- Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 Homepage: www.tengfei.name English Blog: www.tengfei.name/en Chinese Blog: www.tengfei.name/ch [[alternative HTML version deleted]] __ 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 provide commented, minimal, self-contained, reproducible code.
Re: [R] how to manipulate object in specific environment?
Hi Henrique, Thank you so much, that's exactly what I want! Thanks again Tengfei On Thu, Apr 8, 2010 at 3:28 PM, Henrique Dallazuanna wrote: > See ?eapply > > On Thu, Apr 8, 2010 at 5:01 PM, Tengfei Yin wrote: > > Hi > > > > I want to simplify my problem into a prototype, how to write a function > to > > get all the object in your current environment, e.g. .GlobalEnv, and > print > > their mode? > > > > For example, if I have object a,b,c... in my environment, > > a=1;b='test';c=matrix(0,3,3). > > > > I want to write a function myfun(), when I run myfun(), this retrieve all > > the objects in my environment automatically and print their mode or class > > one by one. > > > > Thanks > > > > Regards > > > > Tengfei > > > > -- > > Tengfei Yin > > MCDB PhD student > > 1620 Howe Hall, 2274, > > Iowa State University > > Ames, IA,50011-2274 > > Homepage: www.tengfei.name > > English Blog: www.tengfei.name/en > > Chinese Blog: www.tengfei.name/ch > > > >[[alternative HTML version deleted]] > > > > __ > > 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 provide commented, minimal, self-contained, reproducible code. > > > > > > -- > Henrique Dallazuanna > Curitiba-Paraná-Brasil > 25° 25' 40" S 49° 16' 22" O > -- Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 Homepage: www.tengfei.name English Blog: www.tengfei.name/en Chinese Blog: www.tengfei.name/ch [[alternative HTML version deleted]] __ 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 provide commented, minimal, self-contained, reproducible code.
Re: [R] R GUI
Hi I like gWidgets, you can choose different api, like rgtk2, tcltkeasy to use in R, looks pretty(at least for me), try the examples in the website first, the link below is the answers with tutorial links, you can also check gWidgets vignette. https://stat.ethz.ch/pipermail/r-sig-gui/2008-August/000831.html Regards Tengfei On Mon, Apr 12, 2010 at 3:00 PM, Amitoj S. Chopra wrote: > > I am really new with R Graphical user interfacefunctions. I am developing a > software package to calculate pKa (biochemistry) but I want to make it look > aesthetically pleasing and make it user friendly. I have heard that R has > some GUI (Graphical user interface) and you can do some really cool stuff > out there. What are the limitations and what are some resources for help. I > have found a couple of sources but I was wondering someone with more > experience in the subject can guide me. Thanks! > -- > View this message in context: > http://n4.nabble.com/R-GUI-tp1837662p1837662.html > Sent from the R help mailing list archive at Nabble.com. > > __ > 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 provide commented, minimal, self-contained, reproducible code. > -- Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 Homepage: www.tengfei.name English Blog: www.tengfei.name/en Chinese Blog: www.tengfei.name/ch [[alternative HTML version deleted]] __ 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 provide commented, minimal, self-contained, reproducible code.
Re: [R] Select single column, preserve name?
Hi Try line[,line<=-0.7,drop=F] drop=F,keep the dimensions. On Mon, Apr 19, 2010 at 5:15 PM, Duncan Elkins wrote: > Hi, list- >I've got a large list of multi-column data and I'd like to filter > it according to a threshold, such as, "show me the values that are > above 0.4 for each line." > > For instance, if the line of data were: > > line > v1 v2v3 v4 v5 v6v7v8 v9 > 1 -0.32 0.66 -0.35 -0.82 0.38 0.66 -0.02 -0.11 -0.64 > > I can do this > > line[,line >= 0.4] >v2 v6 > 1 0.66 0.66 > > and > > > names(line[,line >= 0.4]) > [1] "v2" "v6" > > That's great. But, if there's only one value which passes the test, as in: > > > line[,line <= -0.7] > [1] -0.82 > > The single value loses its name attribute (in this case, I want "v4"). > I guess I could kludge this by adding a dummy column that always > passes and trimming it out of the output, later, but it seems like > there ought to be an easier way. Am I misusing the bracket notation, > or ignorant of some obvious way to subset just one column and retain > its name? > > Thanks, > Duncan > > __ > 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 provide commented, minimal, self-contained, reproducible code. > -- Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 Homepage: www.tengfei.name English Blog: www.tengfei.name/en Chinese Blog: www.tengfei.name/ch [[alternative HTML version deleted]] __ 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 provide commented, minimal, self-contained, reproducible code.
Re: [R] A question about plot.mcmc
Hi I have mone quick question I am not quite familiar with, for generic function plot, why some methods are marked by '*', I think plot(as.mcmc()) may dispatch the right method, I try to use get to view the function, but it seems that get() only works for the one with no "*", e.g. get('plot.ecdf') get('plot.mcmc*') doesn't work, why? > methods('plot') [1] plot.acf* plot.data.frame*plot.Date* [4] plot.decomposed.ts* plot.defaultplot.dendrogram* [7] plot.densityplot.ecdf plot.factor* [10] plot.formula* plot.hclust*plot.histogram* [13] plot.HoltWinters* plot.isoreg*plot.lm [16] plot.mcmc* plot.mcmc.list* plot.medpolish* [19] plot.mlmplot.POSIXct* plot.POSIXlt* [22] plot.ppr* plot.prcomp*plot.princomp* [25] plot.profile.nls* plot.shingle* plot.spec [28] plot.spec.coherency plot.spec.phase plot.stepfun [31] plot.stl* plot.table* plot.trellis* [34] plot.ts plot.tskernel* plot.TukeyHSD Thanks Tengfei 2010/4/21 Uwe Ligges > > > On 21.04.2010 20:31, Xiao D wrote: > >> Dear List members, >> I am using R to generate MCMC time series plots. >> This is the code I use; however, everytime an error message will come out >> saying could not find function "plot.mcmc." >> I have coda package and Lattice package installed. >> Does anyone know what may get wrong here? Thanks so much for your >> suggestions. >> Hongli Li >> > > > > Just say plot(mcmcobject) > > The plot generic should call the appropriate methode plot.mcmc that is > hidden in the code namespace. > > Uwe Ligges > > > > >> *library (coda) >> dat1=read.csv("Itemtime.csv") >> col=dim(dat1)[2] >> dat1=dat1[,3:col] >> pdf("Itemtime.pdf") >> plot.mcmc(as.mcmc(dat1),ask=FALSE) >> dev.off() >> * >> >>[[alternative HTML version deleted]] >> >> __ >> 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 provide commented, minimal, self-contained, reproducible code. >> > > __ > 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 provide commented, minimal, self-contained, reproducible code. > -- Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 Homepage: www.tengfei.name [[alternative HTML version deleted]] __ 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 provide commented, minimal, self-contained, reproducible code.
Re: [R] A question about plot.mcmc
Hi David, Thank you so much, that's just what I want!! Best Tengfei On Wed, Apr 21, 2010 at 2:24 PM, David Winsemius wrote: > > On Apr 21, 2010, at 3:21 PM, Tengfei Yin wrote: > > Hi >> >> I have mone quick question I am not quite familiar with, for generic >> function plot, why some methods are marked by '*', I think plot(as.mcmc()) >> may dispatch the right method, I try to use get to view the function, but >> it >> seems that get() only works for the one with no "*", e.g. get('plot.ecdf') >> >> get('plot.mcmc*') doesn't work, why? >> > > ?getAnywhere > > > >> >> methods('plot') >>> >> [1] plot.acf* plot.data.frame*plot.Date* >> [4] plot.decomposed.ts* plot.defaultplot.dendrogram* >> [7] plot.densityplot.ecdf plot.factor* >> [10] plot.formula* plot.hclust*plot.histogram* >> [13] plot.HoltWinters* plot.isoreg*plot.lm >> [16] plot.mcmc* plot.mcmc.list* plot.medpolish* >> [19] plot.mlmplot.POSIXct* plot.POSIXlt* >> [22] plot.ppr* plot.prcomp*plot.princomp* >> [25] plot.profile.nls* plot.shingle* plot.spec >> [28] plot.spec.coherency plot.spec.phase plot.stepfun >> [31] plot.stl* plot.table* plot.trellis* >> [34] plot.ts plot.tskernel* plot.TukeyHSD >> >> >> Thanks >> >> Tengfei >> 2010/4/21 Uwe Ligges >> >> >>> >>> On 21.04.2010 20:31, Xiao D wrote: >>> >>> Dear List members, >>>> I am using R to generate MCMC time series plots. >>>> This is the code I use; however, everytime an error message will come >>>> out >>>> saying could not find function "plot.mcmc." >>>> I have coda package and Lattice package installed. >>>> Does anyone know what may get wrong here? Thanks so much for your >>>> suggestions. >>>> Hongli Li >>>> >>>> >>> >>> >>> Just say plot(mcmcobject) >>> >>> The plot generic should call the appropriate methode plot.mcmc that is >>> hidden in the code namespace. >>> >>> Uwe Ligges >>> >>> >>> >>> >>> *library (coda) >>>> dat1=read.csv("Itemtime.csv") >>>> col=dim(dat1)[2] >>>> dat1=dat1[,3:col] >>>> pdf("Itemtime.pdf") >>>> plot.mcmc(as.mcmc(dat1),ask=FALSE) >>>> dev.off() >>>> * >>>> >>>> [[alternative HTML version deleted]] >>>> >>>> __ >>>> 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 provide commented, minimal, self-contained, reproducible code. >>>> >>>> >>> __ >>> 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 provide commented, minimal, self-contained, reproducible code. >>> >>> >> >> >> -- >> Tengfei Yin >> MCDB PhD student >> 1620 Howe Hall, 2274, >> Iowa State University >> Ames, IA,50011-2274 >> Homepage: www.tengfei.name >> >>[[alternative HTML version deleted]] >> >> __ >> 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 provide commented, minimal, self-contained, reproducible code. >> > > David Winsemius, MD > West Hartford, CT > > -- Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 Homepage: www.tengfei.name [[alternative HTML version deleted]] __ 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 provide commented, minimal, self-contained, reproducible code.
[R] R for Ubuntu 10.04?
Hi dear all I am currently using Ubuntu 9.10 (karmic) and R 2.10, I can find a R release that support "karmic" in cran under ubuntu directory, I plan to update my laptop to Ubuntu 10.04 after April 30, since I have to use some new features or new version in it, e.g. QT 4.6, I don't know if there is going to be a R release that will support this newly released Ubuntu? Thanks Best wishes Tengfei -- Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 Homepage: www.tengfei.name [[alternative HTML version deleted]] __ 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 provide commented, minimal, self-contained, reproducible code.
Re: [R] R for Ubuntu 10.04?
Hi Jeff, Thanks for elucidating and suggestions, I realized I should email the debian mailing list right after I posted here in 'help', sorry for that, then I did get quick response on that mailing list, they told me the distro for Ubuntu 10.04 will be released in couple days, right now, I could upgrade my R to 2.11 and then upgrade my system to Lucid. Thanks again for your suggestions! Best Tengfei On Tue, Apr 27, 2010 at 11:20 AM, Jeff Newmiller wrote: > Tengfei Yin wrote: > >> Hi dear all >> >> I am currently using Ubuntu 9.10 (karmic) and R 2.10, I can find a R >> release >> that support "karmic" in cran under ubuntu directory, I plan to update my >> laptop to Ubuntu 10.04 after April 30, since I have to use some new >> features >> or new version in it, e.g. QT 4.6, I don't know if there is going to be a >> R >> release that will support this newly released Ubuntu? >> >> Thanks >> >> Best wishes >> >> Tengfei >> >> > a) Applications don't "support" distros... it is the other way around. A > distro may introduce improvements, but it is generally considered a bug for > POSIX-compliant distros to upgrade in a manner that leaves existing > application software unable to run (though it may in some cases need to be > recompiled). > > b) Since the quality of support depends on users like you trying it out and > reporting bugs and/or patches, your best bet is to try it and report any > problems you encounter. (I often upgrade by loading the new OS into a > separate partition... but that is more as assurance that the OS itself will > be stable, rather than due to concern about existing applications.) > > c) This mailing list topic is on using the R software. The correct forum > for helping (or observing progress of others) with Debian packages of R > (used on Ubuntu distro) is > > https://stat.ethz.ch/mailman/listinfo/r-sig-debian > > > -- Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 Homepage: www.tengfei.name [[alternative HTML version deleted]] __ 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 provide commented, minimal, self-contained, reproducible code.
Re: [R] by funtion
Hi you could try do.call('rbind',aa) then turn the matrix into data frame regards Tengfei On Wed, Apr 28, 2010 at 10:56 PM, Yuan Jian wrote: > Hello, > > I have a data.frame: > namecol1col2col3col4 > AA23540.9990.78 > BB123510.99 > AA203980.790.99 > > I want to get mean value data.frame in terms of name: > > namecol1col2col3col4 > > AA113. 76. 0.8945 0.8850 > > BB123.00 5.00 1.00 0.99 > > I tried to use by function: > > >aa<-by(test[,2:5], feature, mean) > I found aa is "by" function. > > class(aa) > [1] "by" > > how can I transfer aa to a data frame? > > thanks > YU > > > > > > >[[alternative HTML version deleted]] > > > __ > 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 provide commented, minimal, self-contained, reproducible code. > > -- Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 Homepage: www.tengfei.name [[alternative HTML version deleted]] __ 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 provide commented, minimal, self-contained, reproducible code.
Re: [R] by funtion
Hi, Thanks, actually I mentioned in the reply, you need to turn the matrix into data frame in the end if use this method. e.g > df=data.frame(name=c('AA','BB','AA'),c1=c(23,123,203),c2=c(54,5,98),c3=c(0.999,1,0.79),c4=c(0.78,0.99,0.99)) > aa=by(df[,2:5],df$name,mean) > dd=do.call('rbind',aa) > df=data.frame(dd) > df c1 c2 c3c4 AA 113 76 0.8945 0.885 BB 123 5 1. 0.990 Regards Tengfei On Thu, Apr 29, 2010 at 1:30 AM, Petr PIKAL wrote: > Hi > > r-help-boun...@r-project.org napsal dne 29.04.2010 08:11:41: > > > Hi > > > > you could try > > > > do.call('rbind',aa) > > No, No, No. rbind and cbind binds vectors as rows or columns of > ***matrix***, result is not a data frame > > do.call("rbind",aa) >X069rutil X102anatas > 105 26.97.9 > 200 22.8 10.6 > 400 30.6 13.3 > 600 50.8 20.6 > 800 78.7 NA > exp.df<-do.call("rbind",aa) > str(exp.df) > num [1:5, 1:2] 26.9 22.8 30.6 50.8 78.7 7.9 10.6 13.3 20.6 NA > - attr(*, "dimnames")=List of 2 > ..$ : chr [1:5] "105" "200" "400" "600" ... > ..$ : chr [1:2] "X069rutil" "X102anatas" > > If some object has rectangular shape and has column names it does not > automatically mean that it is data frame > > Regards > Petr > > > > > > > > > then turn the matrix into data frame > > > > regards > > > > Tengfei > > > > On Wed, Apr 28, 2010 at 10:56 PM, Yuan Jian > wrote: > > > > > Hello, > > > > > > I have a data.frame: > > > namecol1col2col3col4 > > > AA23540.9990.78 > > > BB123510.99 > > > AA203980.790.99 > > > > > > I want to get mean value data.frame in terms of name: > > > > > > namecol1col2col3col4 > > > > > > AA113. 76. 0.8945 0.8850 > > > > > > BB123.00 5.00 1.00 0.99 > > > > > > I tried to use by function: > > > > > > >aa<-by(test[,2:5], feature, mean) > > > I found aa is "by" function. > > > > class(aa) > > > [1] "by" > > > > > > how can I transfer aa to a data frame? > > > > > > thanks > > > YU > > > > > > > > > > > > > > > > > > > > >[[alternative HTML version deleted]] > > > > > > > > > __ > > > 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 provide commented, minimal, self-contained, reproducible code. > > > > > > > > > > > > -- > > Tengfei Yin > > MCDB PhD student > > 1620 Howe Hall, 2274, > > Iowa State University > > Ames, IA,50011-2274 > > Homepage: www.tengfei.name > > > >[[alternative HTML version deleted]] > > > > __ > > 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 provide commented, minimal, self-contained, reproducible code. > > -- Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 Homepage: www.tengfei.name [[alternative HTML version deleted]] __ 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 provide commented, minimal, self-contained, reproducible code.
Re: [R] by funtion
Hi Petr, Thanks for your suggestions:) @Yuan, Petr is right, you can try merge(df,df1,'name') Regards Tengfei On Thu, Apr 29, 2010 at 2:20 AM, Petr PIKAL wrote: > Hi > > probably merge is what you want > > see > > ?merge > Regards > Petr > > r-help-boun...@r-project.org napsal dne 29.04.2010 09:13:34: > > > Thanks Tengfei, > > I have another question. > > > df=data.frame(name=c('AA','BB', > 'CC'),c1=c(23,123,5),c2=c(54,5,4),c3=c(0. > > 999,1,23),c4=c(0.78,0.99,54)) > > > df > > name c1 c2 c3c4 > > 1 AA 23 54 0.999 0.78 > > 2 BB 123 5 1.000 0.99 > > 3 CC 5 4 23.000 54.00 > > > > > df1=data.frame(name=c('BB','AA', 'DD'),c5=c(98,87,54),c6=c(7,6,3)) > > > df1 > > name c5 c6 > > 1 BB 98 7 > > 2 AA 87 6 > > 3 DD 54 3 > > > > now I want to get interaction for df and df1 in terms of name. this is > > name c1 c2 c3c4 c5 c6 > > AA 23 54 0.999 0.78 87 6 > > BB123 5 1.000 0.99 98 7 > > > > could give advice? > > > > > > > > > > --- On Thu, 29/4/10, Tengfei Yin wrote: > > > > From: Tengfei Yin > > Subject: Re: [R] by funtion > > To: "Petr PIKAL" > > Cc: "Yuan Jian" , r-help@r-project.org > > Received: Thursday, 29 April, 2010, 6:44 AM > > > > Hi, > > Thanks, actually I mentioned in the reply, you need to turn the matrix > into > > data frame in the end if use this method. e.g > > > > df=data.frame(name=c('AA','BB','AA'),c1=c(23,123,203),c2=c(54,5,98),c3=c(0. > > 999,1,0.79),c4=c(0.78,0.99,0.99)) > > > > > aa=by(df[,2:5],df$name,mean)> dd=do.call('rbind',aa)> > df=data.frame(dd)> > > dfc1 c2 c3c4AA 113 76 0.8945 0.885 > > > > BB 123 5 1. 0.990 > > Regards > > TengfeiOn Thu, Apr 29, 2010 at 1:30 AM, Petr PIKAL > wrote: > > > > > > Hi > > > > > > > > r-help-boun...@r-project.org napsal dne 29.04.2010 08:11:41: > > > > > > > > > Hi > > > > > > > > > > you could try > > > > > > > > > > do.call('rbind',aa) > > > > > > > > No, No, No. rbind and cbind binds vectors as rows or columns of > > > > ***matrix***, result is not a data frame > > > > > > > > do.call("rbind",aa) > > > > X069rutil X102anatas > > > > 105 26.97.9 > > > > 200 22.8 10.6 > > > > 400 30.6 13.3 > > > > 600 50.8 20.6 > > > > 800 78.7 NA > > > > exp.df<-do.call("rbind",aa) > > > > str(exp.df) > > > > num [1:5, 1:2] 26.9 22.8 30.6 50.8 78.7 7.9 10.6 13.3 20.6 NA > > > > - attr(*, "dimnames")=List of 2 > > > > ..$ : chr [1:5] "105" "200" "400" "600" ... > > > > ..$ : chr [1:2] "X069rutil" "X102anatas" > > > > > > > > If some object has rectangular shape and has column names it does not > > > > automatically mean that it is data frame > > > > > > > > Regards > > > > Petr > > > > > > > > > > > > > > > > > > > > > > > > > > > then turn the matrix into data frame > > > > > > > > > > regards > > > > > > > > > > Tengfei > > > > > > > > > > On Wed, Apr 28, 2010 at 10:56 PM, Yuan Jian > > > > wrote: > > > > > > > > > > > Hello, > > > > > > > > > > > > I have a data.frame: > > > > > > namecol1col2col3col4 > > > > > > AA23540.9990.78 > > > > > > BB123510.99 > > > > > > AA203980.790.99 > > > > > > > > > > > > I want to get mean value data.frame in terms of name: > > > > > > > > > > > > namecol1col2col3col4 > > > > > > > > > > > > AA113. 76. 0.8945 0.8850 > > > > > > > > > > > > BB123.00 5.00 1.00 0.99 > > > > > > > > > >
Re: [R] How to extract data table
Hi Maybe ?write.table ?write.csv ?dput On Thu, Apr 29, 2010 at 10:55 AM, ericyujin99 wrote: > > I'm a very new user of R, > The problem I got is when I have lots of data table, 3 columns and 100 rows > assigned to a variable x. > how can I transform the table into a external file excel or other files > without losing any information. So that make the data look nicer. > > -- > View this message in context: > http://r.789695.n4.nabble.com/How-to-extract-data-table-tp2075750p2075750.html > Sent from the R help mailing list archive at Nabble.com. > > __ > 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 provide commented, minimal, self-contained, reproducible code. > -- Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 Homepage: www.tengfei.name [[alternative HTML version deleted]] __ 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 provide commented, minimal, self-contained, reproducible code.
[R] Is there an equivalent of type="where" in predict.rpart, similiar to tree?
In package tree, users can use predict(model,data,type="where") to find out which terminal node the observation belongs to. I can't seem to find a similar function in package rpart. Is there any way to find out the same information using rpart? Thanks! Yin Luo [[alternative HTML version deleted]] __ 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 provide commented, minimal, self-contained, reproducible code.
Re: [R] Manhattan Plot
Hi Einat As Mehmet suggested, you can try plotGrandlinear in ggbio. an example codes in the manual are here http://tengfei.github.com/ggbio/docs/man/plotGrandLinear.html how to install http://www.bioconductor.org/packages/2.11/bioc/html/ggbio.html But one thing is confusing(Maybe I don't get it right what you want), in Manhattan plot, the x-axis shows chromosome names like in those example, even though you have a short list with only 200 SNPs, if you hope to show gene names as x-axis, that's going to be tricky 1. 200(suppose each snp fall in different genes) x-axis labels in a row is hard or imporssible to read in the plot. 2. it's spread over multiple chromosomes, even if you really want to labels them with gene names, it's tricky to do in gglot2 level. IMHO, as a Manhattan overview, you don't have to show all the details like gene names, just to check general distribution and outliers. I guess what you want is probably a gene-list view like in IGV? http://www.broadinstitute.org/igv/gene_list_view suppose your 200 SNPs falls only to a few genes, let's say 10 genes. you may want something like each gene take one facet or panel in a row/grid of plots, would you mind to explain your case? or maybe you can shoot me personal email for collaboration on your case, because complex gene-slit views are not fully supported in ggbio yet. Thanks Tengfei On Tue, Jan 8, 2013 at 1:19 PM, Suzen, Mehmet wrote: > Hello Einat, > > Have you tried ggbio package's plotGrandLinear from bioconductor? > > Best, > -m > > On 8 January 2013 20:03, Einat Granot wrote: > > Hello, > > I am trying to create a simple Manhattan plot for a small list of 200 > SNPs > > spread out in the genome in different genes. > > I have tried different functions (using ggplot2 and a function created by > > Stephen Turner, mhtplot etc.)-none of them work smoothly. > > Does anyone have a simple way to create the plot (not for all 22 > > chromosomes)- with the x axis showing the genes name and not the > chromosomal > > location. > > Thanks a lot, > > Einat > > > > [[alternative HTML version deleted]] > > > > __ > > 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 provide commented, minimal, self-contained, reproducible code. > > __ > 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 provide commented, minimal, self-contained, reproducible code. > -- Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 [[alternative HTML version deleted]] __ 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 provide commented, minimal, self-contained, reproducible code.
[R] prediction.strength in r package fpc
Hi i am using prediction.strength with k-medoids algorithms. There are simple examples like prediction.strength(iriss,2,3,M=3,method="pam") I wrote my code like prediction.strength(data,2,6,M=10,clustermethod=pamkCBI,DIST,krange=2:6,diss=TRUE,usepam=TRUE) because i am using the dissimilarity matrix instead of the data itself for the clustering algorithms. But then i got this error message: Error in switch(method, kmeans = kmeans(xdata[indvec[[l]][[i]], ], k, : EXPR must be a length 1 vector can someone please help me to correct my code? i would be very thankful:) many regards xy [[alternative HTML version deleted]] __ 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 provide commented, minimal, self-contained, reproducible code.
[R] How to deal with multiple class ROC analysis in R (pROC package)?
Here is the question link: http://stackoverflow.com/questions/20507108/how-to-deal-with-multiple-class-roc-analysis-in-r-proc-package Thanks! -- *Yin Zhao <http://www.linkedin.com/in/zhaoyin>* *My Blogger <http://ameenzhao.blogspot.com/>* [[alternative HTML version deleted]] __ 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 provide commented, minimal, self-contained, reproducible code.
Re: [R] R crashes with large vectors
Hi Jeremie, Maybe you can take a look at the bigmemory package. If you have multi core or have access to clusters, you may want to use any parallel computing strategy. For plotting of large data, if you are using basic R graphics, first try to use "line" instead of using 'point', if this still doesn't working, you may want to try an alternative way by using qtinterface (R-forge project), install qtbase and qtpaint, they are still under development, but painting in QT interface is a lot faster for large data set. Best Tengfei On Fri, Jul 9, 2010 at 2:42 AM, Jeremie Smaga wrote: > Good afternoon, > > I have been experiencing a lot of crashes working with large vectors in R. > > Specifically, I am using XTS of length of minimum 120k elements. > > My problem is that I cannot display the vector (otherwise R crashes), I > cannot plot it either (otherwise R crashes). That could be solved by > reducing the amount of points. > > However, I have been performing some statistical opreations on is and even > sd(myXTS) crashes R. > > By "crashes", I mean shuts down without any warning whatsoever. > > I use R 2.11.1 (64). > > Has anyone had the same kind of problem? > > Can we solve this? > > Best, > > > -- > Jeremie > >[[alternative HTML version deleted]] > > __ > 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 provide commented, minimal, self-contained, reproducible code. > -- Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 Homepage: www.tengfei.name [[alternative HTML version deleted]] __ 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 provide commented, minimal, self-contained, reproducible code.
[R] 测试
²âÊÔ -- Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 Homepage: www.tengfei.name [[alternative HTML version deleted]] __ 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 provide commented, minimal, self-contained, reproducible code.
[R] 测试3
²âÊÔ3 -- Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 Homepage: www.tengfei.name [[alternative HTML version deleted]] __ 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 provide commented, minimal, self-contained, reproducible code.
[R] 测试4测试4测试4测试4
²âÊÔ4²âÊÔ4²âÊÔ4²âÊÔ4²âÊÔ4²âÊÔ4²âÊÔ4²âÊÔ4²âÊÔ4²âÊÔ4²âÊÔ4 -- Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 Homepage: www.tengfei.name [[alternative HTML version deleted]] __ 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 provide commented, minimal, self-contained, reproducible code.
Re: [R] 测试3
Sorry! I apologize for my mistake! 2010/8/15 Tengfei Yin > ²âÊÔ3 > > -- > Tengfei Yin > MCDB PhD student > 1620 Howe Hall, 2274, > Iowa State University > Ames, IA,50011-2274 > Homepage: www.tengfei.name > > > -- Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 Homepage: www.tengfei.name [[alternative HTML version deleted]] __ 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 provide commented, minimal, self-contained, reproducible code.
[R] Sorry, I have changed the Chinese R help mailing list name to avoid similarity problem.
Sorry for my mistake, I set Chinese help mailing list as r-h...@r-china.org, the first time I sent my test mail, I use auto-complete in gmail to finish my input, so I sent chinese character to English help mailing list, anyway, that warned me the potential problem in the future. I have change the Chinese mailing list name to, without prefix 'r-', or any other mailing list, below is the new one. h...@r-china.org In order to avoid auto-complete mistake in the future. Sorry to bother you guys Thanks Tengfei -- Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 Homepage: www.tengfei.name <http://www.tengfei.name>R Chinese: www.r-china.org [[alternative HTML version deleted]] __ 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 provide commented, minimal, self-contained, reproducible code.
Re: [R] installing a package in linux
Hi R basic packages always works fine in my laptop (also ubuntu), you don't need to reinstall anything once you installed the package, did you do that in your terminal like $R (enter R session) >install.packages('package name') >q() then everytime you enter the R session, you just library('package name'), that should work... I don't know if it is sth about user privilege , do you use R on your own computer or on other servers? Regards Tengfei On Tue, May 4, 2010 at 2:25 PM, Fahim Md wrote: > I recently started using ubuntu 9.10 and I am using gedit editor and R > plugin for writing R code. To install any package I need to do: > $ install.packages() > //window pop-up for mirror selection > //then another window pop up for package selection. > After this as long as I am not exiting, the function of the newly installed > packages are available. > > After I exit (i use to put 'no' in 'save workspace' option) from R, if I > want to again work in R, I have to repeat the process of package install. > This reintallation problem was not there in windows(I was using Tinn-R as > editor, I just need to put require('package-name') to use its function). > > Is there anyway so that reinstallation of the package is avoided??? > thanks > --Fahim > >[[alternative HTML version deleted]] > > __ > 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 provide commented, minimal, self-contained, reproducible code. > -- Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 Homepage: www.tengfei.name [[alternative HTML version deleted]] __ 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 provide commented, minimal, self-contained, reproducible code.
Re: [R] installing a package in linux
Hi The weird part in this case is that, if you didn't run sudo R, and install the package, it will create a library in your home directory, you should also be able to use the package next time. Regards Tengfei On Wed, May 5, 2010 at 1:53 AM, Ruihong Huang < ruihong.busin...@googlemail.com> wrote: > On 05/05/2010 02:44 AM, Tengfei Yin wrote: > >> Hi >> >> R basic packages always works fine in my laptop (also ubuntu), you don't >> need to reinstall anything once you installed the package, did you do that >> in your terminal like >> $R (enter R session) >> >> >>> install.packages('package name') >>> q() >>> >>> >> then everytime you enter the R session, you just library('package name'), >> that should work... I don't know if it is sth about user privilege , do >> you >> use R on your own computer or on other servers? >> >> Regards >> >> Tengfei >> >> >> On Tue, May 4, 2010 at 2:25 PM, Fahim Md wrote: >> >> >> >>> I recently started using ubuntu 9.10 and I am using gedit editor and R >>> plugin for writing R code. To install any package I need to do: >>> $ install.packages() >>> //window pop-up for mirror selection >>> //then another window pop up for package selection. >>> After this as long as I am not exiting, the function of the newly >>> installed >>> packages are available. >>> >>> After I exit (i use to put 'no' in 'save workspace' option) from R, if I >>> want to again work in R, I have to repeat the process of package install. >>> This reintallation problem was not there in windows(I was using Tinn-R as >>> editor, I just need to put require('package-name') to use its function). >>> >>> >>> >> There is nothing to do with the editor. I guess, you should run "sudo R" > (you shouldn't use this to run a normal R session) in Ubuntu, which will > give you the right to write into the R directory typically in /usr/lib. And > then using "install.packages('package.name')" inside this R session. To > load a library at beginning of each R session, you might consider the .First > function like, > > .First <- function(){ > library('package.name') > invisible() > } > > and then quite R session with work space saved. > > Best, > > Ruihong > > Is there anyway so that reinstallation of the package is avoided??? >>> thanks >>> --Fahim >>> >>>[[alternative HTML version deleted]] >>> >>> __ >>> 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 provide commented, minimal, self-contained, reproducible code. >>> >>> >>> >> >> >> >> > > -- Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 Homepage: www.tengfei.name [[alternative HTML version deleted]] __ 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 provide commented, minimal, self-contained, reproducible code.
[R] reshape cast to a sparse matrix?
I am using the reshape package to convert a series of values into a binary matrix. The binary matrix is very sparse with many zeros and I'd like to use cast to generate a sparse matrix using any of the sparse matrix packages of choice. Is there functionality to support this use? Are there strategies or other packages that that may be useful? Due to memory constraints, it would be best to convert to sparse matrix on the fly rather than build the full matrix and then convert it. Thanks for the help, Yin [[alternative HTML version deleted]] __ 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 provide commented, minimal, self-contained, reproducible code.
[R] Bezier curve in R?
Hi dear all, I am wondering if there is a function existing in R that did the quadratic bezier curve interpolation? I hope to generate a bezier curve based on three sets of points: two end of the line and a control point. Thanks in advance. Tengfei -- Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 [[alternative HTML version deleted]] __ 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 provide commented, minimal, self-contained, reproducible code.
Re: [R] Bezier curve in R?
Hi Prof. Frank Harrell, The bezier function in Hmisc package is exactly what I am looking for. Thanks a lot! Tengfei On Tue, Nov 22, 2011 at 2:55 PM, Frank Harrell wrote: > require(Hmisc) > ?bezier > ?drawPlot > > Frank > > Tengfei Yin wrote > > > > Hi dear all, > > > > I am wondering if there is a function existing in R that did the > quadratic > > bezier curve interpolation? I hope to generate a bezier curve based on > > three sets of points: two end of the line and a control point. > > > > Thanks in advance. > > > > Tengfei > > > > -- > > Tengfei Yin > > MCDB PhD student > > 1620 Howe Hall, 2274, > > Iowa State University > > Ames, IA,50011-2274 > > > > [[alternative HTML version deleted]] > > > > __ > > R-help@ 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. > > > > > - > Frank Harrell > Department of Biostatistics, Vanderbilt University > -- > View this message in context: > http://r.789695.n4.nabble.com/Bezier-curve-in-R-tp4097274p4097309.html > Sent from the R help mailing list archive at Nabble.com. > > __ > 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 provide commented, minimal, self-contained, reproducible code. > -- Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 Homepage: www.tengfei.name [[alternative HTML version deleted]] __ 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 provide commented, minimal, self-contained, reproducible code.
Re: [R] Help! I couldn't put multiple qplot on the same page...
library(gridExtra) ?grid.arrange I found this function convenient to me, it could arrange multiple ggplot object on the same view window p1 <- qplot(...) p2 <- qplot(...) grid.arrange(p1, p2, ..., nrow = 2) different from your design, but for the same purpose I guess. cheers Tengfei On Wed, Dec 7, 2011 at 5:08 PM, Michael wrote: > Thanks a lot! > > Now I can see the individual plot, but still not the > originally-desired multi-plot-on-one-page? > > Any thoughts? Thanks again! > > On 12/7/11, Yihui Xie wrote: > > This is probably one of the most frequently asked questions. The > > answer is to print() the objects. See R FAQ 7.22. > > > > > http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-do-lattice_002ftrellis-graphics-not-work_003f > > > > Regards, > > Yihui > > -- > > Yihui Xie > > Phone: 515-294-2465 Web: http://yihui.name > > Department of Statistics, Iowa State University > > 2215 Snedecor Hall, Ames, IA > > > > > > > > On Wed, Dec 7, 2011 at 4:38 PM, Michael wrote: > >> I found that if I run each "qplot" manually it would plot out > something... > >> > >> but if I put it into the loop, > >> > >> it just doesn't work at all - sometimes it refused to plot anything... > >> > > > > __ > 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 provide commented, minimal, self-contained, reproducible code. > -- Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 Homepage: www.tengfei.name [[alternative HTML version deleted]] __ 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 provide commented, minimal, self-contained, reproducible code.
[R] ggExtra package installation fails
Hi dear all, I cannot find ggExtra source code or install it by install.packages("ggExtra", repos="http://R-Forge.R-project.org";) I am really interested in one of the functions inside called "align.plots", but cannot find the package on-line. Do I miss something? or is there any function similar to that I can easily align multiple plots on the same x-axis on one page. which only align panels. grid.arrange in gridExtra is an easy way to arrange multiple plots, but it's kind of not what exactly I want, there is a discussion of it on stackoverflow. http://stackoverflow.com/questions/5489250/specifying-ggplot2-panel-width see the plots in the anwser, with unequal y label, align.plots still align the plots well on the x. In my real world example, it's not the case that I can make it a simple facet, it's always alignment of multiple tracks. And I don't really want to write my own hack function(and don't know how yet) to do that, if there is already a nice function for the same purpose~ Thanks~ Tengfei -- Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 [[alternative HTML version deleted]] __ 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 provide commented, minimal, self-contained, reproducible code.
Re: [R] ggExtra package installation fails
Hi Milan, thanks for the response, I guess grid.arrange does't really serve the purpose I want(or maybe my grid using level just limits the usage..), like mentioned by Baptiste. On Sun, Jan 15, 2012 at 5:13 PM, baptiste auguie < baptiste.aug...@googlemail.com> wrote: > ggExtra was not compatible with the recent changes in ggplot2 and had > become partially redundant, so I removed it. > > grid.arrange and arrangeGrob in gridExtra won't help with the > alignment of axes. align.plots, which I can always send you offlist if > you want, extracted the size of axes and legends from the plots and > adjusted a grid layout accordingly; it was basically a hack. > > Hi Baptiste, I really appreciate the awesome work you have done for add-ons of ggplot2 ~ and yes, that would be very helpful if you could send me the align.plots() function offlist, even though I am not sure if it can handle complicated case, like when the top plot is faceted with strip labeling and the bottom plot is not. But I guess it should solve lots of cases I have here. or I could look into your code and try to do some extra hack. (might ask for help from you later :)) Kohske has been doing some good progress in properly aligning ggplot2 > graphics, you could try his development branch @github (but I > understand it's at an experimental stage) > https://github.com/kohske/ggplot2 Could you please point me to some specific function in git for aligning ggplot2 graphics? thanks a lot. > > baptiste > > > > On 16 January 2012 11:21, Milan Bouchet-Valat wrote: > > Le dimanche 15 janvier 2012 à 15:43 -0600, Tengfei Yin a écrit : > >> Hi dear all, > >> > >> I cannot find ggExtra source code or install it by > >> > >> install.packages("ggExtra", repos="http://R-Forge.R-project.org";) > > This package has been removed, it's been marked as deprecated by its > > author: > > > http://groups.google.com/group/ggplot2-dev/browse_thread/thread/e1d2a0faa03b7991 > > > >> I am really interested in one of the functions inside called > "align.plots", > >> but cannot find the package on-line. > >> > >> Do I miss something? or is there any function similar to that I can > easily > >> align multiple plots on the same x-axis on one page. which only align > >> panels. grid.arrange in gridExtra is an easy way to arrange multiple > plots, > >> but it's kind of not what exactly I want, there is a discussion of it > on > >> stackoverflow. > >> > http://stackoverflow.com/questions/5489250/specifying-ggplot2-panel-width > >> > >> see the plots in the anwser, with unequal y label, align.plots still > align > >> the plots well on the x. In my real world example, it's not the case > that > >> I can make it a simple facet, it's always alignment of multiple tracks. > And > >> I don't really want to write my own hack function(and don't know how > yet) > >> to do that, if there is already a nice function for the same purpose~ > > Maybe the arrangeGrob() function from gridExtra? > > http://code.google.com/p/gridextra/wiki/arrangeGrob > > > > > > Regards > > > > __ > > 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 provide commented, minimal, self-contained, reproducible code. > -- Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 Homepage: www.tengfei.name [[alternative HTML version deleted]] __ 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 provide commented, minimal, self-contained, reproducible code.
[R] semi-transparency not supported in devel R? "alpha" cannot be specified in qplot()
Hi dear all, In my laptop(ubuntu 11.10 64bit), I maintained a released R (2.14) and a developmental R, I can specify qplot(..., alpha = ) in R 2.14 , but when I try to use transparency in developmental R, I got a warning message and the plot is clearly not I want. minimal example: > qplot(data = mtcars, x = mpg, y = cyl, alpha = cyl) Warning message: In grid.Call.graphics(L_points, x$x, x$y, x$pch, x$size) : semi-transparency is not supported on this device: reported only once per page > sessionInfo() R Under development (unstable) (2012-01-21 r58156) Platform: x86_64-unknown-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=C LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] grid stats graphics grDevices utils datasets methods [8] base other attached packages: [1] ggplot2_0.8.9 proto_0.3-9.2 reshape_0.8.4 plyr_1.7.1 loaded via a namespace (and not attached): [1] digest_0.5.1 I have no idea what happened here, because if I miss some important system dependencies, why it's still working in R 2.14? Any suggestions or possible solution will be really appreciated. Thanks Tengfei -- Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 [[alternative HTML version deleted]] __ 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 provide commented, minimal, self-contained, reproducible code.
Re: [R] Interactive map graphics.
Hi Kevin, I haven't watched through the video yet, but I guess It's not ggplot2, just like David pointed out, it's actually using a different graphic engine, implemented in packages qtbase/qtpaint, which are hosted on Biocondcutor, to install them, please run source("http://www.bioconductor.org/biocLite.R";) biocLite(c("qtbase", "qtpaint")) Another project in development you probably are interested in trying for same kind of qt-based interactive graphics called cranvas https://github.com/ggobi/cranvas HTH Tengfei On Tue, Jan 24, 2012 at 12:57 PM, David Winsemius wrote: > > On Jan 24, 2012, at 1:15 PM, Kevin Burton wrote: > > I just watched >> >> >> >> http://www.youtube.com/watch?**v=iSXNfZESR5I<http://www.youtube.com/watch?v=iSXNfZESR5I> >> >> >> >> and there is a section where Hadley Wickham showed demonstrated a county >> map >> of the US that was interactive. This is exactly what I would like. I have >> downloaded ggplot2 but still failed to find out how to even read in and >> plot >> something like a US map let alone add the kind of interactivity that was >> shown in this demo. Anyone else succeed at interacting with a plot of the >> US >> like this? >> > > https://github.com/hadley/vis-**migration<https://github.com/hadley/vis-migration> > > [[alternative HTML version deleted]] >> > > Sigh. > > -- > > David Winsemius, MD > West Hartford, CT > > > __** > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/**listinfo/r-help<https://stat.ethz.ch/mailman/listinfo/r-help> > PLEASE do read the posting guide http://www.R-project.org/** > posting-guide.html <http://www.R-project.org/posting-guide.html> > and provide commented, minimal, self-contained, reproducible code. > -- Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 Homepage: www.tengfei.name [[alternative HTML version deleted]] __ 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 provide commented, minimal, self-contained, reproducible code.
Re: [R] [BioC] Overlay Gene Expression on SNP (copy number) data
On Mon, Apr 23, 2012 at 6:33 AM, Ekta Jain wrote: > Hello, > Can anyone please suggest any packages in R that can be used to overlay > gene expression data on SNP (affymetrix) copy number ? > Hi Ekta, If you mean visually, as Steve suggested, you could try packages like ggbio, Gviz, Rcytoscape.. it depends on how you plan to visualize your data, track-based? circular view? net work? and what format your data are? for example, in ggbio, it depends on what data you are using, you can arrange your data into GRanges manually or just provide data that rtracklayer supported like bed, then just use autoplot, it accepts different objects, like GRanges, IRanges, bamfiles or character... allow some transformation like coverage. For files like bed, it automatically use bar to represent your data and use score as y(you can specify other y). Function tracks() allow you to bind or overlay any graphics produced by ggbio or ggplot2, so you could work from data.frame too, it will help you align your plots after the graphics are produced. For genomic structure, if you want to overlay with your data, try autoplot, TranscriptDb. And if you want to show interaction between genes, you could try either arches in linear view or links in circular view(layout_circle). http://tengfei.github.com/ggbio/ this website is still under development, just to show some possible cases, it will be re-built against R 2.15 and more case studies are coming. HTH Tengfei > > Thanks, > Ekta > Senior Research Associate > Bioinformatics Department > Jubilant Biosys Pvt Ltd, > #96, Industrial Suburb, 2nd Stage > Yeshwantpur, Bangalore 560 022 > Ph No : +91-80-66628346 > > The information contained in this electronic message and in any > attachments to this message is confidential, legally privileged and > intended only for use by the person or entity to which this electronic > message is addressed. If you are not the intended recipient, and have > received this message in error, please notify the sender and system manager > by return email and delete the message and its attachments and also you are > hereby notified that any distribution, copying, review, retransmission, > dissemination or other use of this electronic transmission or the > information contained in it is strictly prohibited. Please note that any > views or opinions presented in this email are solely those of the author > and may not represent those of the Company or bind the Company. Any > commitments made over e-mail are not financially binding on the company > unless accompanied or followed by a valid purchase order. This message has > been scanned for viruses and dangerous content by Mail Scanner, a! > nd is believed to be clean. The Company accepts no liability for any > damage caused by any virus transmitted by this email. > www.jubl.com > >[[alternative HTML version deleted]] > > ___ > Bioconductor mailing list > bioconduc...@r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > -- Tengfei Yin MCDB PhD student 1620 Howe Hall, 2274, Iowa State University Ames, IA,50011-2274 Homepage: www.tengfei.name [[alternative HTML version deleted]] __ 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 provide commented, minimal, self-contained, reproducible code.