Re: [R] How to write text in bar plot in R?

2012-06-12 Thread arun
Hi, Try the format from this example: mp <- barplot(VADeaths)  tot <- colSums(VADeaths)     text(mp, tot+6, format(tot), xpd = TRUE, col = "red")  text(mp, c("A","B","C","D"), xpd = TRUE, col = "blue") I hope it helps. A.K. - Original Message - From: Manish Gupta To: r-help@r-pr

Re: [R] adjust space between horizontal legend text in a barplot

2012-06-12 Thread arun
Hi, Sorry about that.  My mistake. Try this:  barplot(VADeaths, names=rep("", 4), col=gray(1:3/4+0.01)) legend("bottom", legend=expression(scriptstyle("Strongly disagree/disagree"),scriptstyle("Neutral"),scriptstyle("Strongly agree/agree")), fill=gray(1:3/4+0.01), inset=-0.2, bty='n', horiz=

[R] add horizontal reference lines in lattice bwplot

2012-06-12 Thread Gareth.Williams
I'm plotting a lattice bwplot from a data.frame and would like to add some horizontal lines indicating some reference values (preferably with text annotation) as well as a grid of regular log tics. The following illustrates the plot: data(ToothGrowth) require("lattice") p = bwplot(exp(len) ~ su

Re: [R] How to write text in bar plot in R?

2012-06-12 Thread Manish Gupta
Here Text message is kind of error message for no data available. regards -- View this message in context: http://r.789695.n4.nabble.com/How-to-write-text-in-bar-plot-in-R-tp4633190p4633211.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] How to build a large identity matrix faster?

2012-06-12 Thread Ceci Tam
that makes sense, thanks for the reply On 13 June 2012 05:53, Uwe Ligges wrote: > > > On 11.06.2012 11:45, Ceci Tam wrote: > >> diag(n) is alright when n = 5e3, it took 0.7 sec on my machine for >> diag(5e3). However, it's slow when n = 23000, diag(23000) took 15 sec >> > > > 1. As others have s

Re: [R] replacing NA for zero

2012-06-12 Thread Rui Barradas
Hello, There's a shorter one, using merge(). DF2 <- merge(data.frame(x=1:8), DF1, all.x = TRUE) DF2$y[is.na(DF2$y)] <- 0 Rui Barradas Em 13-06-2012 02:02, arun escreveu: Hi, I got confused by your heading when I sent the previous reply. There is another way to reach the same conclusion.

Re: [R] How to write text in bar plot in R?

2012-06-12 Thread manish gupta
This does not meet my need as i need to write text as well. On Wed, Jun 13, 2012 at 9:41 AM, Manish Gupta wrote: > Hi, > > I am working on R plot but i need to write some text for the bars where the > value is = 0 > > > counts > > 3 4 5 > 0 12 * 0* 4 > 1 3 *0* 1 > > http://r.789695

Re: [R] Predict in the package R2BayesX

2012-06-12 Thread Achim Zeileis
On Tue, 12 Jun 2012, Paul J Ossenbruggen wrote: I have the same question. This paper may help you. http://eeecon.uibk.ac.at/wopec2/repec/inn/wpaper/2012-10.pdf Thanks for posting this, Paul. The paper above describes the current state of affairs in "R2BayesX". But we are also working on exte

Re: [R] problem about set operation and computation after split

2012-06-12 Thread R. Michael Weylandt
On Wed, Jun 6, 2012 at 2:43 AM, bestbird wrote: > hi, >    I met some problems in R, plz help me. > 1. How to do a intersect operation among several groups in one list, without > a loop statement? (I think It may be a list) >   create data: >   myData <- data.frame(product = c(1,2,3,1,2,3,1,2,2),

[R] How to write text in bar plot in R?

2012-06-12 Thread Manish Gupta
Hi, I am working on R plot but i need to write some text for the bars where the value is = 0 > counts 3 4 5 0 12 * 0* 4 1 3 *0* 1 http://r.789695.n4.nabble.com/file/n4633189/Screenshot-2.png My aim is to write some comment in plot. http://r.789695.n4.nabble.com/file/n4633

Re: [R] How to write text in bar plot in R?

2012-06-12 Thread R. Michael Weylandt
? text Michael On Tue, Jun 12, 2012 at 8:49 PM, Manish Gupta wrote: > Hi, > > I am working on R plot but i need to write some text for the bars where the > value is = 0 > >> counts > >     3  4  5 >  0 12  0  4 >  1  3  0  1 > http://r.789695.n4.nabble.com/file/n4633190/1.png > > My aim is to wr

Re: [R] adjust space between horizontal legend text in a barplot

2012-06-12 Thread R. Michael Weylandt
As noted below: PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. For more on how to do that see: i) https://github.com/hadley/devtools/wiki/Reproducibility ii) http://stackoverflow.com/questions/59632

Re: [R] Analyzing large files faster

2012-06-12 Thread Jorge I Velez
Another alternative is to use ?subset HTH, Jorge.- On Tue, Jun 12, 2012 at 6:06 PM, Rui Barradas <> wrote: > Hello, > > The trick is to use index vectors. They allow us to do without loops. > > Try the following. > > > muscle <- read.table(text=' > > "ID""adj.P.Val" "logFC"

Re: [R] adjust space between horizontal legend text in a barplot

2012-06-12 Thread Jianyun Wu
Thanks for the reply. The one you provide is the vertical legend not for horizontal legend. x.intersp= simply spreads out the space between symbols and legend text. using the existing data in R for example, barplot(VADeaths, names=rep("", 4), col=gray(1:3/4+0.01)) #five levels in this data, but j

[R] fast repeated matrix operations

2012-06-12 Thread Paul Rathouz
Hi -- I am wondering if there is a suite of R functions or an R package for the following types of purpose: Suppose I had a nxpxp array (say, A) and I wanted to invert each pxp "layer" in the array (i.e., solve(A[i,,]) for i in 1:n). Or, suppose I had a nxpxq array (A) and a nxqxr array (B) an

Re: [R] adjust space between horizontal legend text in a barplot

2012-06-12 Thread arun
Hi, Try this.   plot(0)   legend("topright", inset=c(0.2,0),legend=c("Strongly disagree/disagree","Neutral","Strongly agree/agree"), lty=1:3, pch=1:3, x.intersp=2) A.K. - Original Message - From: Jianyun Wu To: r-help@r-project.org Cc: Sent: Tuesday, June 12, 2012 10:45 PM Subject:

Re: [R] How to Read command line parameters in Sweave?

2012-06-12 Thread Manish Gupta
Thanks it works -- View this message in context: http://r.789695.n4.nabble.com/How-to-Read-command-line-parameters-in-Sweave-tp4632493p4633191.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://st

[R] How to write text in bar plot in R?

2012-06-12 Thread Manish Gupta
Hi, I am working on R plot but i need to write some text for the bars where the value is = 0 > counts 3 4 5 0 12 0 4 1 3 0 1 http://r.789695.n4.nabble.com/file/n4633190/1.png My aim is to write some comment in plot. http://r.789695.n4.nabble.com/file/n4633190/2.png How ca

Re: [R] replacing NA for zero

2012-06-12 Thread arun
Hi, I got confused by your heading when I sent the previous reply.  There is another way to reach the same conclusion. Try this: DF1<-data.frame(x=c(2,3,4,6,7),y=c(0.12,0.25,0.11,0.16,0.20)) DF2<-data.frame(x=1:8,y=rep(NA,8))  df3<-merge(DF1,DF2,all=TRUE)  df3[is.na(df3)]<-0 g<-rle(df3[,1]) gV

Re: [R] replacing NA for zero

2012-06-12 Thread arun
Hi, Try this:  dat1<-data.frame(x=1:8,y=c(NA,0.12,0.25,0.11,NA,0.16,0.20,NA))  dat1[is.na(dat1)]<-0  dat1   x    y 1 1 0.00 2 2 0.12 3 3 0.25 4 4 0.11 5 5 0.00 6 6 0.16 7 7 0.20 8 8 0.00 A.K. - Original Message - From: Silvia Lucato To: r-help@r-project.org Cc: Sent: Tuesday, June

Re: [R] Unbalanced Design Power Analysis

2012-06-12 Thread Peter Alspach
Tena koe Jacob Possibly your best option is to simulate. HTH Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jacob Warren (RIT Student) Sent: Wednesday, 13 June 2012 4:40 a.m. To: r-help@r-project.org Subject:

Re: [R] problem about set operation and computation after split

2012-06-12 Thread bestbird
can anyone help me? -- View this message in context: http://r.789695.n4.nabble.com/problem-about-set-operation-and-computation-after-split-tp4632496p4633192.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing l

[R] templated use of aggregate

2012-06-12 Thread Matthew Johnson
Dear R-help, I have an xts data set that i have subset by date. now it contains a date-time-stamp, and two columns (price and volume traded): my objective is to create tables of volume traded at a price - and i've been successfully using aggregate to do so in interactive use. say the data looks

Re: [R] what does .indexDate() do - R::xts

2012-06-12 Thread Matthew Johnson
thanks. i think i understand: the difference is that the first command converts my 'searched-for' date to a number and matches it, but the second does not? On 13 June 2012 12:58, Joshua Ulrich wrote: > On Tue, Jun 12, 2012 at 9:48 PM, Matthew Johnson > wrote: > > Dear R experts, > > > > I am le

Re: [R] what does .indexDate() do - R::xts

2012-06-12 Thread Joshua Ulrich
On Tue, Jun 12, 2012 at 9:48 PM, Matthew Johnson wrote: > Dear R experts, > > I am learning the very useful XTS package, but cannot figure out the > purpose of some commands. > > in particular, the .indexDate() command does not work as expected. > > say: > > x <- timeBasedSeq('2010-01-01/2010-01-0

[R] what does .indexDate() do - R::xts

2012-06-12 Thread Matthew Johnson
Dear R experts, I am learning the very useful XTS package, but cannot figure out the purpose of some commands. in particular, the .indexDate() command does not work as expected. say: x <- timeBasedSeq('2010-01-01/2010-01-02 12:00') x <- xts(1:length(x), x) then i can subset on date as follows:

[R] adjust space between horizontal legend text in a barplot

2012-06-12 Thread Jianyun Wu
Hi All, I produced a barplot and made a horizontal legend below the graph. Because the results are from a survey, there are three levels, namely strongly disagree/disagree, neutral and strongly agree/agree. > rownames(survey)[1] "Strongly disagree/disagree" "Neutral" > "Stron

Re: [R] Analyzing large files faster

2012-06-12 Thread Rui Barradas
Hello, The trick is to use index vectors. They allow us to do without loops. Try the following. muscle <- read.table(text=' "ID" "adj.P.Val" "logFC" "Gene.symbol" "1419156_at" "5.32e-12""2.6462565" "Sox4" "1433575_at" "5.32e-12""3.9417089" "Sox4" "

[R] foreach performance

2012-06-12 Thread Dom Pazzula
I'm noticing a huge performance hit when using foreach with doSNOW.  Any ideas on why the parallel loop runs ~8 times slower than the same foreach run sequentially?   > require(doSNOW) Loading required package: doSNOW Loading required package: foreach foreach: simple, scalable parallel programmin

Re: [R] How to build a large identity matrix faster?

2012-06-12 Thread Uwe Ligges
On 11.06.2012 11:45, Ceci Tam wrote: diag(n) is alright when n = 5e3, it took 0.7 sec on my machine for diag(5e3). However, it's slow when n = 23000, diag(23000) took 15 sec 1. As others have said already, for huge data, the Matrix implementation for diagonals is the right idea, since it ac

Re: [R] replacing NA for zero

2012-06-12 Thread Rolf Turner
A simplistic approach which works for the given example is as follows: Let your data frame be "X". Do: x <- 1:8 y <- numeric(8) y[X$x] <- X$y Y <- data.frame(x=x,y=y) Then "Y" is the desired result. cheers, Rolf Turner On 13/06/12 09:55, Silvia Lucato wrote: Dear R users,

Re: [R] Rotating characters in text

2012-06-12 Thread Rui Barradas
Hello, (You forgot to unlist() the result of strsplit.) Another way, saving some space between characters is to use strheight(). rotate90 <- function(x, y, label){ label <- unlist(strsplit(label, '')) y <- y - (seq_along(label) - 1)*strheight(label) list(x=x, y=y, label

Re: [R] replacing NA for zero

2012-06-12 Thread Helios de Rosario
> Dear R users, > > I have a very basic query, but was unable to find a proper anwser. > > I have the following data.frame > > x y > 2 0.12 > 3 0.25 > 4 0.11 > 6 0.16 > 7 0.20 > > and, due to further calculations, I need the data to be stored as > > x y > 1

Re: [R] eclipse cran r

2012-06-12 Thread Luke Miller
Read through this page on float (figure) placement: http://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions In particular, trying including \usepackage{float} in your TeX preamble and then place figures using the big [H] option: \begin{figure}[H] That may accomplish what you want in term

Re: [R] How to index a matrix with different row-number for each column?

2012-06-12 Thread Zhenjiang Lan
Thank you, it works. by the way, sometime I guess *apply functions act like loop, because when I apply a complicated function, they run slowly and one by one. On Tue, Jun 12, 2012 at 3:39 PM, Rui Barradas wrote: > Hello, > > Try > > sapply(seq_len(ncol(mt2)), function(j) mt1[mt2[, j], j]) > > > H

Re: [R] How to index a matrix with different row-number for each column?

2012-06-12 Thread Rui Barradas
Hello, Try sapply(seq_len(ncol(mt2)), function(j) mt1[mt2[, j], j]) Hope this helps, Rui Barradas Em 12-06-2012 17:19, Zhenjiang Lan escreveu: mt1: [,1] [,2] [,3] [1,] "G" "A" "A" [2,] "C" "T" "C" mt2: [,1] [,2] [,3] [1,]122 [2,]212 [3,]22

[R] replacing NA for zero

2012-06-12 Thread Silvia Lucato
Dear R users, I have a very basic query, but was unable to find a proper anwser. I have the following data.frame x y 2 0.12 3 0.25 4 0.11 6 0.16 7 0.20 and, due to further calculations, I need the data to be stored as x y 1

Re: [R] Rotating characters in text

2012-06-12 Thread David Winsemius
On Jun 12, 2012, at 4:02 PM, Greg Snow wrote: If you insert `\n` between each letter, then it should do what you want with a single call to text or mtext. To expand on David's example: plot(1:10) text(5,5, paste( strsplit(txvec, ''), collapse='\n') ) In fact it could be made even easier:

[R] GEE with Inverse Probability Weights

2012-06-12 Thread RFrank
Greetings, I have a very, very, simple research question. I want to predict one dichotomous variable using another dichotomous variable. Straightforward, right? The issue is that the dataset has two issues causing some complications for me. 1) The subjects are not independent -- they are sibli

Re: [R] Error in if (rank) { : argument is not interpretable as logical

2012-06-12 Thread Uwe Ligges
On 11.06.2012 17:47, Duarte Viana wrote: Hello all, I am running the function "rda" of the vegan library, like I did many times without having troubles, and I get the following error message: "Error in if (rank) { : argument is not interpretable as logical". I am just testing a response matri

[R] Analyzing large files faster

2012-06-12 Thread mousy0815
I'm trying to analyze the following data set (sample): "ID""adj.P.Val" "logFC""Gene.symbol" "1419156_at""5.32e-12" "2.6462565" "Sox4" "1433575_at""5.32e-12" "3.9417089" "Sox4" "1428942_at""2.64e-11" "3.9163618" "Mt2" "1

[R] SAP ABAP Consultant available

2012-06-12 Thread Kanna
[1]Click here to unsubscribe if you no longer wish to receive our emails Hello, We have an excellent consultant, Pritesh Agrawal - SAP ABAP . Below is his/her quick profile for your review. Pritesh Agrawal - SAP ABAP - Rate: Open Total Exp: 9+ Available: immediate

Re: [R] Not able to write to PostgreSQL database using "dbWriteTable"

2012-06-12 Thread Mark Dalphin
I just tested your code and I _think_ you have a misconception about dbWriteTable(). Your code has some oddities so I am only guessing; for example, what is "zz" and why is it in this snippet? In the absence of information on the database TABLE, it is even harder to guess what you are doing,

Re: [R] Rotating characters in text

2012-06-12 Thread baptiste auguie
Try this, rotate = function(x) paste(strsplit(x,"")[[1]],collapse="\n") t <- "this is a text" plot.new() text(1/2,1/2,t) par(lheight=0.8) text(1/2,1/2,rotate(t)) HTH, b. On 13 June 2012 01:49, Stuart Rosen wrote: > For labelling a plot, I am trying to rotate a character string using text() >

Re: [R] String Manipulation in R

2012-06-12 Thread Greg Snow
Or use 'fixed=TRUE' as an argument to grepl to avoid the regular expression matching (but learning regular expressions will be a useful tool in the long run). On Tue, Jun 12, 2012 at 9:15 AM, Jeff Newmiller wrote: > ?grepl > > Note that this function uses regular expressions, in which certain cha

Re: [R] Rotating characters in text

2012-06-12 Thread Greg Snow
If you insert `\n` between each letter, then it should do what you want with a single call to text or mtext. To expand on David's example: plot(1:10) text(5,5, paste( strsplit(txvec, ''), collapse='\n') ) On Tue, Jun 12, 2012 at 10:16 AM, David Winsemius wrote: > > On Jun 12, 2012, at 9:49 AM

Re: [R] Yahoo/Google quotes symbols

2012-06-12 Thread R. Michael Weylandt
TTR::stockSymbols Michael On Tue, Jun 12, 2012 at 1:12 PM, Vikram Bahure wrote: > Dear R users, > > I was working on get.hist.quote to download data, but for this I need to > know yahoo quotes (for stocks) from the beginning. Is there any simple way > to get all symbols for particular market or

[R] where to find a host server with R

2012-06-12 Thread Xiaokuan Wei
Hi, I am building a website with using R and bioconductor packages. I am wondering where I can find a good quality hosting service which provides servers running R and allows me to install various bioconductor packages. Does anyone have such experience? Thank you. -Xiaokuan [[alternati

Re: [R] eclipse cran r

2012-06-12 Thread Trying To learn again
Hi JEssica I have tried but for the moment I´m getting crazyso I let for the future to understand for instance why the viewer doesn´t goes, and so on. Actually I´m using "Tex Maker" and I attach code using funtion \begin{lstlisting} so on The only "inconvenience" in Latex is always is

[R] Yahoo/Google quotes symbols

2012-06-12 Thread Vikram Bahure
Dear R users, I was working on get.hist.quote to download data, but for this I need to know yahoo quotes (for stocks) from the beginning. Is there any simple way to get all symbols for particular market or I have to go on the website and get the quotes. Thanks for your help in advance. Regards V

Re: [R] Predict in the package R2BayesX

2012-06-12 Thread Paul J Ossenbruggen
I have the same question. This paper may help you. http://eeecon.uibk.ac.at/wopec2/repec/inn/wpaper/2012-10.pdf Best of luck. Paul -- View this message in context: http://r.789695.n4.nabble.com/Predict-in-the-package-R2BayesX-tp4632618p4633145.html Sent from the R help mailing list archive at

Re: [R] How to subset a matrix?

2012-06-12 Thread David Winsemius
On Jun 12, 2012, at 1:58 PM, David Winsemius wrote: On Jun 12, 2012, at 12:44 PM, Michael wrote: Hi all, Lets say I have a matrix A which is m x n. I also have a mask matrix MASK which is m x n with values in T/F, where T values make a sub-matrix in regutangular shape... I applied B=A[

Re: [R] How to subset a matrix?

2012-06-12 Thread David Winsemius
On Jun 12, 2012, at 12:44 PM, Michael wrote: Hi all, Lets say I have a matrix A which is m x n. I also have a mask matrix MASK which is m x n with values in T/F, where T values make a sub-matrix in regutangular shape... I applied B=A[MASK] and it didn't work as expected... Perhaps: (no

Re: [R] Attempting to update from R 2.14 to 2.15

2012-06-12 Thread John Kane
Thanks I have just subscribed. John Kane Kingston ON Canada > -Original Message- > From: nord...@dshs.wa.gov > Sent: Tue, 12 Jun 2012 17:26:02 + > To: jrkrid...@inbox.com, r-help@r-project.org > Subject: RE: [R] Attempting to update from R 2.14 to 2.15 > >> -Original Message

Re: [R] Predict in the package R2BayesX

2012-06-12 Thread Paul J Ossenbruggen
I have the same question. This paper may help you. http://eeecon.uibk.ac.at/wopec2/repec/inn/wpaper/2012-10.pdf Best of luck. Paul -- View this message in context: http://r.789695.n4.nabble.com/Predict-in-the-package-R2BayesX-tp4632618p4633144.html Sent from the R help mailing list archive at

Re: [R] How to subset a matrix?

2012-06-12 Thread Petr Savicky
On Tue, Jun 12, 2012 at 11:44:51AM -0500, Michael wrote: > Hi all, > > Lets say I have a matrix A which is m x n. > > I also have a mask matrix MASK which is m x n with values in T/F, where T > values make a sub-matrix in regutangular shape... > > I applied B=A[MASK] and it didn't work as expect

Re: [R] the largest independent (stable) set on graphs

2012-06-12 Thread Gábor Csárdi
The unreleased 0.6 version of igraph has a much faster implementation for this, you can download a nightly build source R package from here: https://code.google.com/p/igraph/downloads/list Make sure that you download the right file, there are C, Python packages there as well. I can send you a wind

Re: [R] How to subset a matrix?

2012-06-12 Thread Oliver Ruebenacker
Hello, On Tue, Jun 12, 2012 at 12:44 PM, Michael wrote: > Hi all, > > Lets say I have a matrix A which is m x n. > > I also have a mask matrix MASK which is m x n with values in T/F, where T > values make a sub-matrix in regutangular shape... > > I applied B=A[MASK] and it didn't work as exp

Re: [R] Attempting to update from R 2.14 to 2.15

2012-06-12 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: John Kane [mailto:jrkrid...@inbox.com] > Sent: Tuesday, June 12, 2012 10:07 AM > To: Nordlund, Dan (DSHS/RDA); r-help@r-project.org > Subject: RE: [R] Attempting to update from R 2.14 to 2.15 > > The problem is that the Ubuntu site still has 2.14 and won't upda

Re: [R] Attempting to update from R 2.14 to 2.15

2012-06-12 Thread arun
HI, Maybe this link will be useful. (http://ubuntuforums.org/showthread.php?p=11876430). I also updated to R2.15 from 2.14 in Ubuntu 11.10 (Now I upgraded to 12.04, so the update command is disabled).  I added one line in /etc/apt/sources.list   deb http://cran.mtu.edu/bin/linux/ubuntu oneiric/

Re: [R] How to subset a matrix?

2012-06-12 Thread Sarah Goslee
Providing a reproducible example is a good idea, but what about this: > A <- matrix(1:20, nrow=4) > MASK <- matrix(FALSE, nrow=4, ncol=5) > MASK[2:3, 1:3] <- TRUE > MASK [,1] [,2] [,3] [,4] [,5] [1,] FALSE FALSE FALSE FALSE FALSE [2,] TRUE TRUE TRUE FALSE FALSE [3,] TRUE TRUE TRUE

Re: [R] Attempting to update from R 2.14 to 2.15

2012-06-12 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: John Kane [mailto:jrkrid...@inbox.com] > Sent: Tuesday, June 12, 2012 9:42 AM > To: Nordlund, Dan (DSHS/RDA); r-help@r-project.org > Subject: RE: [R] Attempting to update from R 2.14 to 2.15 > > Thanks Dan. > > Results > sudo apt-key adv --keyserver keyserver.

Re: [R] Attempting to update from R 2.14 to 2.15

2012-06-12 Thread John Kane
The problem is that the Ubuntu site still has 2.14 and won't update til something like Ubuntu 12.10 or whatever the next release is. Thanks for all the help. John Kane Kingston ON Canada > -Original Message- > From: nord...@dshs.wa.gov > Sent: Tue, 12 Jun 2012 16:58:27 + > To: jr

Re: [R] Attempting to update from R 2.14 to 2.15

2012-06-12 Thread John Kane
Thanks arun, Thanks arun . It looked good but no luck. I have updated my /etc/apt/sources.list, apparently installed the gpg code etc thanks to Dan N's pointers by no go. Still the same error message when doing sudo ap-get update. John Kane Kingston ON Canada > -Original Message---

[R] Unbalanced Design Power Analysis

2012-06-12 Thread Jacob Warren (RIT Student)
I have an unbalanced design I would like to run a power analysis on. What I have been able to find has pointed me to using the pwr.f2.test function as described below. My problem is that I don't know how to appropriately define the numerator and demoninator df. If someone can help here is some mor

[R] Specifying spatial correlation Form in nmle

2012-06-12 Thread Gary Dong
Dear R users, I'm applying a correlation structure in a mixed model (nmle function) to control for spatial correlation between land parcels that are adjacent to each other. I generated X,Y coordinates in ArcGIS for each land parcel and used them in the correlation form like this: test.exp<-corExp

[R] How to subset a matrix?

2012-06-12 Thread Michael
Hi all, Lets say I have a matrix A which is m x n. I also have a mask matrix MASK which is m x n with values in T/F, where T values make a sub-matrix in regutangular shape... I applied B=A[MASK] and it didn't work as expected... Any thoughts? [[alternative HTML version deleted]] _

Re: [R] Attempting to update from R 2.14 to 2.15

2012-06-12 Thread John Kane
Thanks Dan. Results sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9 [sudo] password for john: Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /tmp/tmp.28YKFHKFht --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg -

Re: [R] R-SCRIPT Label Calling Method

2012-06-12 Thread Oliver Ruebenacker
Hello, On Tue, Jun 12, 2012 at 11:13 AM, R. Michael Weylandt wrote: > Long answer: use a closure if for some bizarre reason you just can't > use a loop. Do you mean use recursion? Take care Oliver -- Oliver Ruebenacker Bioinformatics Consultant (http://www.knowomics.com/wiki/

Re: [R] How do I connect dots in the RGL package?

2012-06-12 Thread David Winsemius
On Jun 12, 2012, at 11:45 AM, Maaike_020 wrote: Hi all, I just started using the rgl package in R, and I need to know how I connect the dots I created. A simple line from one coördinate (x0,y0,z0) to another (x1,y1,z1) will do. I tried using the code rgl.lines, but it doesn't accept lin

[R] the largest independent (stable) set on graphs

2012-06-12 Thread Diogo Alagador
I am using the igraph package and I would like to obtain only 1 largest independent set from a sparse graph with aprox. 600 vertices. When I used the largest.independent.vertex.sets command I cannot obtain all the sets in a decent time, even if I need only 1. Any ideas on how to solve this?

Re: [R] How to index a matrix with different row-number for each column?

2012-06-12 Thread William Dunlap
Use a 2-column matrix of integer subscripts, the first column being the row indexes and the the second the column indexes: > mt<-matrix(1:12,ncol=6) > vt<-c(1,2,2,2,1,2) > mt[cbind(vt,1:6)] [1] 1 4 6 8 9 12 Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Mess

Re: [R] How to index a matrix with different row-number for each column?

2012-06-12 Thread R. Michael Weylandt
I think you are looking for mt[cbind(vt, seq_along(vt))] which uses some trickines known as matrix indexing (basically, the two columns created by cbind() are considered row & col indices -- then seq_along() gives the col1,col2, bit as needed. HTH, Michael On Tue, Jun 12, 2012 at 10:28 AM, Zhe

Re: [R] R-SCRIPT Label Calling Method

2012-06-12 Thread Oliver Ruebenacker
Hello, On Tue, Jun 12, 2012 at 10:25 AM, Rantony wrote: > Hi, > > here i have some code... > > > a <-1 > b <- b+1 > c <- b+a/20 > if c >5 > { d<- 1 } > else {  d<- 0  } > > i want to repeat this code from the 2nd line [b <- b+1] without using loop. > Actulay i want to use  "*Label *" and cal

Re: [R] String Manipulation in R

2012-06-12 Thread Rui Barradas
Hello, Yes, there is. See ?grepl or help('grepl'). Hope this helps, Rui Barradas Em 12-06-2012 14:51, anjali escreveu: Hi , Is there any inbuilt functions to check whether a substring is present in a string and give the result as boolean Thanks -- View this message in context: http://r.78

Re: [R] Data.frames can not hold objects...What can be done in the following scenario?

2012-06-12 Thread Rui Barradas
Hello, You're right, to put lists or vectors as elements of data frames is not the best practice. Note, however, that the opposite is not true, it's common and good practice to have data frames and other objects as list elements, especially if they are in some way related. If, for instance,

Re: [R] lme random slope results the same as random slope and intercept model

2012-06-12 Thread ONKELINX, Thierry
Dear John, R-sig-mixed-models is a better list for this kind of questions. It looks like the model finds no evidence for a random slope. Notice the very small variance of the random slope. In the model without random intercept, the random slope tries to mimic the effect of a random intercept.

Re: [R] How to index a matrix with different row-number for each column?

2012-06-12 Thread Zhenjiang Lan
I thought I solved my question but actually not... What I really want is to translate a matrix: mt1: [,1] [,2] [,3] [1,] "G" "A" "A" [2,] "C" "T" "C" mt2: [,1] [,2] [,3] [1,]122 [2,]212 [3,]222 [4,]111 I want to translate all the "1"

Re: [R] Rotating characters in text

2012-06-12 Thread David Winsemius
On Jun 12, 2012, at 9:49 AM, Stuart Rosen wrote: For labelling a plot, I am trying to rotate a character string using text() so that characters are upright and reading down, for example, ... L i k e t h i s . It appears that par crt does not work with text. Does anyone have any other s

Re: [R] String Manipulation in R

2012-06-12 Thread Jeff Newmiller
?grepl Note that this function uses regular expressions, in which certain characters have special meanings, so depending on what string you are looking for you may have to know something about regex patterns to get it to work. -

Re: [R] Reference on data manipulation

2012-06-12 Thread R. Michael Weylandt
Probably Spector (http://www.amazon.com/Data-Manipulation-R-Use/dp/0387747303) if you want a dead-tree book. Otherwise, just read the archives of this list and the R-bloggers aggregator and you should be able to pick up most everything you need. Michael On Tue, Jun 12, 2012 at 9:58 AM, XINLI LI

Re: [R] R-SCRIPT Label Calling Method

2012-06-12 Thread ONKELINX, Thierry
Is this homework? If it is, please read the posting guide. ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium + 32 2 525 02 51 + 32 54

[R] prediction of sales with VAR model

2012-06-12 Thread Michael Lee
Hi, I work in a kitchen production factory and I try to predict sales of kitchen for an horizon of 12 weeks, and I have to turn into account promotions. My sales are express in number of command, my promotion are express with dummy variables. (1 if promotion, 0 else). The first problem is that my

[R] How do I connect dots in the RGL package?

2012-06-12 Thread Maaike_020
Hi all, I just started using the rgl package in R, and I need to know how I connect the dots I created. A simple line from one coördinate (x0,y0,z0) to another (x1,y1,z1) will do. I tried using the code rgl.lines, but it doesn't accept lines that don't stem from O (0,0,0). Please help! Thanks!

[R] Not able to write to PostgreSQL database using "dbWriteTable"

2012-06-12 Thread Prakash Thomas
Dear R User's Please help me to debug this issue. I am trying to write some data ( i= 6) to PostgreSQL database, but it not writing. Is there any issue in the way I use "dbWriteTable"? ++ Source Code library("DBI") library("RPostgreSQL") drv1 <- dbDriv

Re: [R] Attempting to update from R 2.14 to 2.15

2012-06-12 Thread Nordlund, Dan (DSHS/RDA)
See if the SECURE APT section of the following link helps. http://cran.r-project.org/bin/linux/ubuntu/README Dan Daniel J. Nordlund Washington State Department of Social and Health Services Planning, Performance, and Accountability Research and Data Analysis Division Olympia, WA 98504-5204 >

[R] Attempting to update from R 2.14 to 2.15

2012-06-12 Thread John Kane
I am very new to Linux so I probably am doing something stupid but I cannot seem to update to R 2.15 Using Ubuntu 12.02 Precise Penguin I realise that debian packages are not updated regularly so I tried to follow the insructions at the R-site So far, I have modified /etc/apt/sources.list to r

Re: [R] How to index a matrix with different row-number for each column?

2012-06-12 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Zhenjiang Lan > Sent: Tuesday, June 12, 2012 8:28 AM > To: r-help@r-project.org > Subject: [R] How to index a matrix with different row-number for each > column? > > here's my qu

Re: [R] How to index a matrix with different row-number for each column?

2012-06-12 Thread Zhenjiang Lan
Thank you very much! that's exactly what I want. On Tue, Jun 12, 2012 at 10:32 AM, R. Michael Weylandt wrote: > I think you are looking for > > mt[cbind(vt, seq_along(vt))] > > which uses some trickines known as matrix indexing (basically, the two > columns created by cbind() are considered row &

[R] How to index a matrix with different row-number for each column?

2012-06-12 Thread Zhenjiang Lan
here's my question: suppose I have a matrix: mt<-matrix(1:12,ncol=6) now I have a vector vt<-c(1,2,2,2,1,2) which means I want to get: the 1st row for column1; the 2nd row for column2; the 2nd row for column3; the 2nd row for column4; ... that what I want is this vector: 1,4,6,8,9,12

Re: [R] lme random slope results the same as random slope and intercept model

2012-06-12 Thread John Sorkin
Thierry, Thank you for your thoughts. I agree with your analysis, but am still surprised that the results are not approximately, but exactly the same to the limit of the precision of the printed results. The exact comparability of the results makes me wonder if something else is going on that I

Re: [R] R-SCRIPT Label Calling Method

2012-06-12 Thread R. Michael Weylandt
Short answer: no. Long answer: use a closure if for some bizarre reason you just can't use a loop. Bonus tip: change the last three lines to: d <- c > 5 for speed and clarity! Michael On Tue, Jun 12, 2012 at 9:25 AM, Rantony wrote: > Hi, > > here i have some code... > > > a <-1 > b <- b+1 >

Re: [R] Memory warning (Reached total allocation of ...) - but no error

2012-06-12 Thread atan
Hi all I have searched for a solution to the following problem and even tried emailing the original poster, but have not had any luck in finding an answer. Magnus Torfason-2 wrote > > I'm getting the following warnings inside a loop: > > Warning messages: > 1: In calc.measures(g, 1, i) : >

Re: [R] String Manipulation in R

2012-06-12 Thread R. Michael Weylandt
grepl Michael On Tue, Jun 12, 2012 at 8:51 AM, anjali wrote: > Hi , > Is there any inbuilt functions  to check whether a substring is present in a > string and give the result as boolean > Thanks > > > -- > View this message in context: > http://r.789695.n4.nabble.com/String-Manipulation-in-R-t

[R] Reference on data manipulation

2012-06-12 Thread XINLI LI
Dear Group: What is the best reference book on data manipulation with R in the market now? Thanks, XING __ 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/post

[R] lme random slope results the same as random slope and intercept model

2012-06-12 Thread John Sorkin
R 2.15.0 Windows XP Can someone help me understand why a random intercept model gives the same results as the random intercept and slope models? I am rather surprised by the results I am getting from lme. I am running three models (1) random intercept fitRI <- lme(echogen~time,rando

Re: [R] Error in sort(abs(diff(genomdat)))[1:n.keep] : only 0's may be mixed with negative subscripts

2012-06-12 Thread R. Michael Weylandt
Your problem is that n.keep is less than 0. Why that is I cannot tell without appropriate context. E.g., x <- 1:10 x[2:5] x[0:1] x[(-3):1] Michael On Tue, Jun 12, 2012 at 6:01 AM, sanshine wrote: > Hello everyone, > > I`m trying to normalize and analize an illumina SNP array. > But when i`m

[R] R-SCRIPT Label Calling Method

2012-06-12 Thread Rantony
Hi, here i have some code... a <-1 b <- b+1 c <- b+a/20 if c >5 { d<- 1 } else { d<- 0 } i want to repeat this code from the 2nd line [b <- b+1] without using loop. Actulay i want to use "*Label *" and call *GoTo* method like in other coding Languages. For eg:- like this,

Re: [R] Reading binary files

2012-06-12 Thread Nortisiv
Rui Barradas wrote > > Hello, > > From the help page for readBin: > > "readBin and writeBin read and write C-style zero-terminated character > strings." > > > Your description of the string doesn't match this one. To read any sort > of character strings, use readChar. > > readChar(to.read

Re: [R] Two-way linear model with interaction but without one main effect

2012-06-12 Thread Helios de Rosario
Thanks for the suggestion, Thierry. Nevertheless, in this example I'm not considering "shoe" as a random, nuisance factor with zero mean. I'm considering three specific shoe models, and I'm interested in modelling how the output changes between the different shoes for those grounds, given that the

  1   2   >