Re: [R] ForestPlot or similar
Thanks Matt, I am having a problem now to use this function. The function separately works fine. But the problem is that I am working with a simulation, so i placed the CREDPLOT function in my program and added the following commands according my data: #MY DATA, ESTIMATES, LOWER AND UPPER INTERVALS rw_cibas_quantile_ori_m-rw_quantile_app_ori[-51:-1000] rw_cibas_low_quantile_ori_l-rw_cibas_low_quantile_ori[-51:-1000] rw_cibas_up_quantile_ori_u-rw_cibas_up_quantile_ori[-51:-1000] #GRAPHIC jpeg ('Nfp_rw_bas_quantile_ori.jpeg') forestplot(rw_cibas_quantile_ori_m,rw_cibas_low_quantile_ori_l,rw_cibas_up_quantile_ori_u,cen=403.677) dev.off() My program is running fine, but I am not getting any graphic. I did the graphic using the function FORESTPLOT, but the graphic provided by the function CREDPLOT is much better. Here is my code: rw_ciper_gini_ori_m-rw_gini_app_ori[-51:-1000] rw_ciper_low_gini_ori_l-rw_ciper_low_gini_ori[-51:-1000] rw_ciper_up_gini_ori_u-rw_ciper_up_gini_ori[-51:-1000] tabletext-cbind(c(rep( ,50),NA)) rw_ciper_gini_ori_m-c(rw_ciper_gini_ori_m,NA) rw_ciper_low_gini_ori_l-c(rw_ciper_low_gini_ori_l,NA) rw_ciper_up_gini_ori_u-c(rw_ciper_up_gini_ori_u,NA) jpeg ('Sfp_rw_per_gini_ori.jpeg') forestplot(tabletext,rw_ciper_gini_ori_m,rw_ciper_low_gini_ori_l,rw_ciper_up_gini_ori_u,zero=0.4,col=meta.colors(box=royalblue,line=darkblue)) dev.off() Any information about whats is missing/wrong in order to obtain the graphic with the function CREDPLOT is welcomed. Thanks is advance, Marcio -- View this message in context: http://r.789695.n4.nabble.com/ForestPlot-or-similar-tp3020374p3024354.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.
[R] ForestPlot or similar
Hi listers, I am trying to plot some confidence intervals. The function FORESTPLOT, would work, but I need something more simple. I dont need to define the text labels. Is there another function that I can plot some confidence intervals. Thanks in advance, Marcio -- View this message in context: http://r.789695.n4.nabble.com/ForestPlot-or-similar-tp3020374p3020374.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.
Re: [R] ForestPlot or similar
Here is one example: I have three vectors (mean,lower interval, upper interval) mean-c(2,4,6,8) l-c(1,2,3,4) u-c(4,8,12,16) How would I plot that if I want to use the FORESTPLOT function. I dont need to use the TABLETEXT option. I am working in something like this: tabletext-c(NA,NA,NA,NA,NA) mean-c(NA,2,4,6,8) l-c(NA,1,2,3,4) u-c(NA,4,8,12,16) forestplot(tabletext,mean,l,u,zero=0) But I am having a problem with the length of the dimension... Thanks in advance, Marcio -- View this message in context: http://r.789695.n4.nabble.com/ForestPlot-or-similar-tp3020374p3020394.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.
Re: [R] Size of the legend
Hi Denis, Check it out my code... This is not my real data... I would like to manage the size of the legend... Set the legend smaller than it is, because on my real data, the legend is over the values... Thanks for the help... x-runif(100) y-runif(100) color-c(rep(1,15),rep(2,20),rep(3,15),rep(4,10),rep(5,10),rep(6,15),rep(7,10),rep(8,5)) plot(x,y,col=c(black,blue,green,red,red,green,blue,black)[color],pch=c(22,3,3,3,19,19,19,23)[color],main=' ',xlab='Sample Mean',ylab='Bootstrap Variance Estimators') legend(topleft, legend=c(All 3 outliers,Presence of 2 outliers (6,263 and 6,720),Presence of 2 outliers (3,471 and 6,720),Presence of 2 outliers (3,471 and 6,263),Presence of outlier 6,720,Presence of outlier 6,263,Presence of outlier 3,471,No outlier), col = c(black,blue,green,red,red,green,blue,black), pch = c(23,19,19,19,3,3,3,22), lty=c(1,1), xjust=0, yjust=0, bty=n) -- View this message in context: http://r.789695.n4.nabble.com/Size-of-the-legend-tp2547601p2549063.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.
[R] Size of the legend
Hello, Which would be the command to change the size of the legend. I checked at the help and I found out something about TEXT.WIDTH, but I am not sure if is what I want. Any help! Thanks in advance, Marcio -- View this message in context: http://r.789695.n4.nabble.com/Size-of-the-legend-tp2547601p2547601.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.
[R] If then else with command for
Hey listers, I am trying to do something simple... Check the program below... I would like to create a variable named COLOR according to the conditions that I stablished... But the problem is that it seems that my variable COLOR is checking just on sample, may be last in the loop... Certainly, I am missing something... Thanks in advance, Marcio x-c(288,139,196,159,536,134,623,517,96,467,277,155,386,241,422,6263,612,532,250,412,339,55,290,249,164,97,74,144,1277,240,163,63,488,111,128,230,720,179,37,24,65,37,89,187,60,939,1008,81,310,58,169,38,68,190,78,807,220,226,69,179129,119,73,59,92,127,104,75,505,183,49,41,76,113,90,79,408,140,200,284,103,58,654,118,431,192,233,102,97,56,69,73,86,53,105,81,77,472,129,194,299,81,122,113,186,91,145,133,114,78,78,72,70,3471,641,275,815,149,185,172,240,67,526,122,229,298,317,179,233,66,129,87,82,63,65,72,6720,381,240,118,396,66,35,43,166,216,53,82,90,62,77,207,68,52,277,396,220,751,146,95,37,35,39,46,59,44,105,87,66,62,175,252,128,330,57,83,208,74,63,109,37,105,38,82,76,63,86,603,209,100,121,191,130,63,128,90,79,50,1025,121,87,309,75,189,36,82,84,60,132,46,965,155,132,219,112,53,90,66,100,77,52,60,100,153,418,392,76,130,197,262,49,105,87,70,147,720,342,233,203,249,92,134,231,782,184,182,432,49,63,94,124,69,53,91,451,53,21,42,50,40,32,58,26,28,61,60,35,764,105,592,55,28,46,34,123,4! 1,54,207,64,562,295,226,63,233) R-142 color-rep(0,142) for(i in 1:R){ x-sample(x,142,replace=FALSE) if (!3471 %in% x !6263 %in% x !6720 %in% x){color[i]-1} else if (3471 %in% x !6263 %in% x !6720 %in% x){color[i]-2} else if (!3471 %in% x 6263 %in% x !6720 %in% x){color[i]-3} else if (!3471 %in% x !6263 %in% x 6720 %in% x){color[i]-4} else if (3471 %in% x 6263 %in% x !6720 %in% x){color[i]-5} else if (3471 %in% x !6263 %in% x 6720 %in% x){color[i]-6} else if (!3471 %in% x 6263 %in% x 6720 %in% x){color[i]-7} else if (3471 %in% x 6263 %in% x 6720 %in% x){color[i]-8} else{color[i]-0} } -- View this message in context: http://r.789695.n4.nabble.com/If-then-else-with-command-for-tp2539341p2539341.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.
Re: [R] If then else with command for
Yep... Got that... I just changed my data name... It worked fine... Thanks... -- View this message in context: http://r.789695.n4.nabble.com/If-then-else-with-command-for-tp2539341p2539429.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.
[R] Condition %in%
Hi listers, If I would like to check if a variable contains certain value, I would write: if (10 %in% x) And If I would like to check the opposite, that 10 is not into x. How would be? Thanks in advance, Marcio -- View this message in context: http://r.789695.n4.nabble.com/Condition-in-tp2538110p2538110.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.
[R] Function Gini or Ineq
Hi listers, Does it necessary to install any package in order to use the GINI or INEQ functions. If I use the following command the R tells me that didn't find the GINI function. x-c(541, 1463, 2445, 3438, 4437, 5401, 6392, 8304, 11904, 22261) G-gini(x) Thanks in advance, Marcio -- View this message in context: http://r.789695.n4.nabble.com/Function-Gini-or-Ineq-tp2525852p2525852.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.
Re: [R] Function Gini or Ineq
Hi Dimitris, I have already seen your code in another post. But, I would like to weight my data. So, I wish I could use the following command: gini(x, weights=rep(1,length=length(x))) Thanks anyway and I am trying to understand your gini function in order to apply a weigth. Marcio -- View this message in context: http://r.789695.n4.nabble.com/Function-Gini-or-Ineq-tp2525852p2525896.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.
Re: [R] Function Gini or Ineq
Hi Peng, I did that i installed the package RELDIST, but nothing happened. R does not recognize this function. Still looking for the solution. Thanks, Marcio -- View this message in context: http://r.789695.n4.nabble.com/Function-Gini-or-Ineq-tp2525852p2525981.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.
[R] Ordering data by variable
Hi listers, I could order a data that like this: x-c(2,6,8,8,1) y-c(1,6,3,5,4) o-order(x) frame-rbind(x,y)[,o] But, I would like to know if there is a way to order my data without setting up a data frame. I would like to keep independent vectors x and y. Any suggestions? Thanks in advance, Marcio -- View this message in context: http://r.789695.n4.nabble.com/Ordering-data-by-variable-tp2524754p2524754.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.
[R] Scatterplot - Overlap Frequency
Hi listers... I am working o a scatterplot where I would like to plot the variables according with another frequency variable. Another friend here proposed this code... x - rnorm(10) y - rnorm(10) ind - c(1,0,1,0,1,0,1,1,0,0) plot(x, y, col = ind + 1, pch = 16) # 1 is black, 2 is red But in my case I would like to identify with different colors according with a frequency variable. x - rnorm(10) y - rnorm(10) ind - c(3,0,1,0,3,0,2,2,0,0) I made some research and I would like to do something like the function HEXBIN does: source(http://bioconductor.org/biocLite.R;) biocLite(hexbin) library(hexbin) x - rnorm(1000) y - rnorm(1000) bin-hexbin(x, y, xbins=50) plot(bin, main=Hexagonal Binning) But in my case I have another variable with the frequency and not high density frequency according the two plotted variables... Any suggestions, thanks... Marcio -- View this message in context: http://r.789695.n4.nabble.com/Scatterplot-Overlap-Frequency-tp2323322p2323322.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.
[R] Data manipulation search
Hi listers, I made some search, but i didn`t find in the forum. I have a data set. I would like to make a search (conditon) on my data set. x-c(1,2,3,4,5,6,7,8,9,10) count-0 if (CONDITON){count-1}else{count-0} My CONDITION would be: is there number 5 in my data set? Thanks in advance, Marcio -- View this message in context: http://r.789695.n4.nabble.com/Data-manipulation-search-tp2321927p2321927.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.
[R] Graphic Dispersion - Colored Points
Hey folks, I have a graphic of dispersion... I would like to color some specific points (x,y) according to another indicator variable, for example: x-rnorm(5) y-rnorm(5) ind-(1,0,0,1,0) plot(x,y) Any suggestion, thanks... Marcio -- View this message in context: http://r.789695.n4.nabble.com/Graphic-Dispersion-Colored-Points-tp2322011p2322011.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.
[R] read.table (trying one more time)
Hey listers, I've posted this doubt other day... But I am still having a hard time... I have a MAC and I am not getting how to use the read.table command... At the bottom of the FINDER application I have the following path: Macintosh HDUsuáriosUserMarcioUdeMTravail DirigéDataMU284 Population.txt I didn't find out how I could copy and paste this path as it is possible to do with the Windows. But, it's ok, cause I am trying the following command with all possible choices, as below: file-read.table(/User/Marcio/UdeM/Travail Dirigé/Data/MU284 Population.txt,header=T,skip=24) file-read.table(/Users/Marcio/UdeM/Travail Dirigé/Data/MU284 Population.txt,header=T,skip=24) file-read.table(/Usuários/User/Marcio/UdeM/Travail Dirigé/Data/MU284 Population.txt,header=T,skip=24) file-read.table(/Usuários/Users/Marcio/UdeM/Travail Dirigé/Data/MU284 Population.txt,header=T,skip=24) I've checked already the forum and I found a similar post that says to use the command with the following path: /Users/Marcio/UdeM/Travail Dirigé/Data/MU284 Population.txt But at the bottom of the FINDER application is just USER. Anyway I tried those options and other... But didn't work... If anybody could give me a clue... THANKS A LOT!!! Marcio -- View this message in context: http://n4.nabble.com/read-table-trying-one-more-time-tp1569653p1569653.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.
Re: [R] READ.TABLE for Mac
Yes, I paste the wrong ERROR MESSAGE... Cause I was checking many options it the problem was about files with separate names... But the problem still persists... I am using the following code: file-read.table(/Users/Márcio/UdeM/Travail Dirigé/Data/MU284 Population.txt,header=T,skip=24) And getting the following error message: Erro em file(file, rt) : não é possível abrir a conexão Além disso: Warning message: In file(file, rt) : cannot open file '/Users/Márcio/UdeM/Travail Dirigé/Data/MU284 Population.txt': No such file or directory Thanks for the help, Marcio -- View this message in context: http://n4.nabble.com/READ-TABLE-for-Mac-tp1557879p1558922.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.
Re: [R] R on MAC OS X
Hi listers, I just got a MAC, so I am trying to use the command READ.TABLE but I am getting a error that is probably caused by the wrong path that I am using... The command is the following... file-read.table(/Users/Márcio/UdeM/Travail Dirigé/Data/MU284 Population.txt,header=T,skip=24) And I am getting the following error... Erro em file(file, rt) : não é possível abrir a conexão Além disso: Warning message: In file(file, rt) : cannot open file '/User/Márcio/UdeM/Travail_Dirigé/Data/MU284_Population.txt': No such file or directory I checked already the messages but I didn't find what could be my mistake... Any suggestions??? Thanks in advance, Marcio -- View this message in context: http://n4.nabble.com/R-on-MAC-OS-X-tp802729p1557818.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.