Re: [R] mhplot error with test example: "ylim not found"
Thank you, everyone. The function works fine now. Vaneet -Original Message- From: Jing Hua Zhao [mailto:jinghua.z...@mrc-epid.cam.ac.uk] Sent: Monday, June 28, 2010 2:46 PM To: Peter Ehlers; Lotay, Vaneet Cc: r-help@r-project.org Subject: RE: [R] mhplot error with test example: "ylim not found" Many thanks Peter. I have uploaded 1.0-23 which should have this fixed. Jing Hua -Original Message- From: Peter Ehlers [mailto:ehl...@ucalgary.ca] Sent: 28 June 2010 15:47 To: vaneet Cc: r-help@r-project.org; Jing Hua Zhao Subject: Re: [R] mhplot error with test example: "ylim not found" It seems to me that gap::mhtplot needs a fix. You might want to contact the maintainer (cc'd). In the meantime, you should be able to place an object ylim in your workspace before calling the function: ylim <- c(0, 10) mhtplot(test, ylim = c(0, 10)) Of course, you could also just fixt the function (it's short and the fix is easy). -Peter Ehlers On 2010-06-23 8:47, vaneet wrote: > > Hello all, > > I am trying to make a genome association plot for p-values related to SNPs > and was fortunate to find that R contains a package that produces Manhattan > plots which is what's preferred for my current project. The function > mhtplot() is found in the 'gap' package which I installed in R 2.11.1 on > Windows. I thought I'd test out the function first with the examples they > give in the documentation: > > # foo example > test<- matrix(c(1,1,4,1,1,6,1,10,3,2,1,5,2,2,6,2,4,8),byrow=TRUE,6) > mhtplot(test) > mhtplot(test,logscale=F) > > # fake example with Affy500k data > affy<-c(40220, 41400, 33801, 32334, 32056, 31470, 25835, 27457, 22864, > 28501, 26273, > 24954, 19188, 15721, 14356, 15309, 11281, 14881, 6399, 12400, 7125, > 6207) > CM<- cumsum(affy) > n.markers<- sum(affy) > n.chr<- length(affy) > test<- data.frame(chr=rep(1:n.chr,affy),pos=1:n.markers,p=runif(n.markers)) > > # to reduce size of the plot > # bitmap("mhtplot.bmp",res=72*5) > oldpar<- par() > par(las="2",cex=0.6) > colors<- rep(c("blue","green"),11) > mhtplot(test,colors=colors,pch=19,bg=colors) > title("A simulated example according to EPIC-Norfolk QCed SNPs") > > When I run either of the examples the following results: > > Error in mhtplot() : object 'ylim' not found > > Even though I'm not sure why it would require this parameter, when I tried > to fill in the parameter (ylim = c(0,10)) the same error results. I am not > sure how to get around this. > > Vaneet __ 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] mhplot error with test example: "ylim not found"
Many thanks Peter. I have uploaded 1.0-23 which should have this fixed. Jing Hua -Original Message- From: Peter Ehlers [mailto:ehl...@ucalgary.ca] Sent: 28 June 2010 15:47 To: vaneet Cc: r-help@r-project.org; Jing Hua Zhao Subject: Re: [R] mhplot error with test example: "ylim not found" It seems to me that gap::mhtplot needs a fix. You might want to contact the maintainer (cc'd). In the meantime, you should be able to place an object ylim in your workspace before calling the function: ylim <- c(0, 10) mhtplot(test, ylim = c(0, 10)) Of course, you could also just fixt the function (it's short and the fix is easy). -Peter Ehlers On 2010-06-23 8:47, vaneet wrote: > > Hello all, > > I am trying to make a genome association plot for p-values related to SNPs > and was fortunate to find that R contains a package that produces Manhattan > plots which is what's preferred for my current project. The function > mhtplot() is found in the 'gap' package which I installed in R 2.11.1 on > Windows. I thought I'd test out the function first with the examples they > give in the documentation: > > # foo example > test<- matrix(c(1,1,4,1,1,6,1,10,3,2,1,5,2,2,6,2,4,8),byrow=TRUE,6) > mhtplot(test) > mhtplot(test,logscale=F) > > # fake example with Affy500k data > affy<-c(40220, 41400, 33801, 32334, 32056, 31470, 25835, 27457, 22864, > 28501, 26273, > 24954, 19188, 15721, 14356, 15309, 11281, 14881, 6399, 12400, 7125, > 6207) > CM<- cumsum(affy) > n.markers<- sum(affy) > n.chr<- length(affy) > test<- data.frame(chr=rep(1:n.chr,affy),pos=1:n.markers,p=runif(n.markers)) > > # to reduce size of the plot > # bitmap("mhtplot.bmp",res=72*5) > oldpar<- par() > par(las="2",cex=0.6) > colors<- rep(c("blue","green"),11) > mhtplot(test,colors=colors,pch=19,bg=colors) > title("A simulated example according to EPIC-Norfolk QCed SNPs") > > When I run either of the examples the following results: > > Error in mhtplot() : object 'ylim' not found > > Even though I'm not sure why it would require this parameter, when I tried > to fill in the parameter (ylim = c(0,10)) the same error results. I am not > sure how to get around this. > > Vaneet __ 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] mhplot error with test example: "ylim not found"
It seems to me that gap::mhtplot needs a fix. You might want to contact the maintainer (cc'd). In the meantime, you should be able to place an object ylim in your workspace before calling the function: ylim <- c(0, 10) mhtplot(test, ylim = c(0, 10)) Of course, you could also just fixt the function (it's short and the fix is easy). -Peter Ehlers On 2010-06-23 8:47, vaneet wrote: Hello all, I am trying to make a genome association plot for p-values related to SNPs and was fortunate to find that R contains a package that produces Manhattan plots which is what's preferred for my current project. The function mhtplot() is found in the 'gap' package which I installed in R 2.11.1 on Windows. I thought I'd test out the function first with the examples they give in the documentation: # foo example test<- matrix(c(1,1,4,1,1,6,1,10,3,2,1,5,2,2,6,2,4,8),byrow=TRUE,6) mhtplot(test) mhtplot(test,logscale=F) # fake example with Affy500k data affy<-c(40220, 41400, 33801, 32334, 32056, 31470, 25835, 27457, 22864, 28501, 26273, 24954, 19188, 15721, 14356, 15309, 11281, 14881, 6399, 12400, 7125, 6207) CM<- cumsum(affy) n.markers<- sum(affy) n.chr<- length(affy) test<- data.frame(chr=rep(1:n.chr,affy),pos=1:n.markers,p=runif(n.markers)) # to reduce size of the plot # bitmap("mhtplot.bmp",res=72*5) oldpar<- par() par(las="2",cex=0.6) colors<- rep(c("blue","green"),11) mhtplot(test,colors=colors,pch=19,bg=colors) title("A simulated example according to EPIC-Norfolk QCed SNPs") When I run either of the examples the following results: Error in mhtplot() : object 'ylim' not found Even though I'm not sure why it would require this parameter, when I tried to fill in the parameter (ylim = c(0,10)) the same error results. I am not sure how to get around this. Vaneet __ 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] mhplot error with test example: "ylim not found"
Hello all, I am trying to make a genome association plot for p-values related to SNPs and was fortunate to find that R contains a package that produces Manhattan plots which is what's preferred for my current project. The function mhtplot() is found in the 'gap' package which I installed in R 2.11.1 on Windows. I thought I'd test out the function first with the examples they give in the documentation: # foo example test <- matrix(c(1,1,4,1,1,6,1,10,3,2,1,5,2,2,6,2,4,8),byrow=TRUE,6) mhtplot(test) mhtplot(test,logscale=F) # fake example with Affy500k data affy <-c(40220, 41400, 33801, 32334, 32056, 31470, 25835, 27457, 22864, 28501, 26273, 24954, 19188, 15721, 14356, 15309, 11281, 14881, 6399, 12400, 7125, 6207) CM <- cumsum(affy) n.markers <- sum(affy) n.chr <- length(affy) test <- data.frame(chr=rep(1:n.chr,affy),pos=1:n.markers,p=runif(n.markers)) # to reduce size of the plot # bitmap("mhtplot.bmp",res=72*5) oldpar <- par() par(las="2",cex=0.6) colors <- rep(c("blue","green"),11) mhtplot(test,colors=colors,pch=19,bg=colors) title("A simulated example according to EPIC-Norfolk QCed SNPs") When I run either of the examples the following results: Error in mhtplot() : object 'ylim' not found Even though I'm not sure why it would require this parameter, when I tried to fill in the parameter (ylim = c(0,10)) the same error results. I am not sure how to get around this. Vaneet -- View this message in context: http://r.789695.n4.nabble.com/mhplot-error-with-test-example-ylim-not-found-tp2265697p2265697.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.