Re: [R] Sum function and missing values --- need to mimic SAS sum function

2015-01-27 Thread JSHuang
Hi, Not sure if the following is what you look for: x - c(1:10, NA, 12:20) sum(x[!is.na(x)]) -- View this message in context: http://r.789695.n4.nabble.com/Sum-function-and-missing-values-need-to-mimic-SAS-sum-function-tp4702344p4702392.html Sent from the R help mailing list archive at

Re: [R] panel.xyplot and panel.loess using two different groupings

2015-01-27 Thread Bert Gunter
Learn to use custom panel functions to give you the flexibility and features you require. In this case, you want something like: xyplot(LRU~PAR|C3C4, groups = species, panel= function(x,y,...){ ## custom panel function to add an overall loess line panel.superpose(x,y,...)

[R-es] Ajuste con exponencial

2015-01-27 Thread Hector Gómez Fuerte
Buenas tardes, cmo puedo con el R ajustar una distribucin exponencial truancada (en el intervalo [10,60]) a un vector de datos? Muchas gracias. Hctor Gmez ___ R-help-es mailing list R-help-es@r-project.org

[R] panel.xyplot and panel.loess using two different groupings

2015-01-27 Thread Timothy W. Hilton
Hello, I have a dataset consisting of four variables: species (factor, five levels), C3C4 (factor, two levels), and numeric variables PAR and LRU. I wish to produce a scatter plot of PAR vs LRU where (1) each species has a unique symbol and color (2) there is an overlaid loess line that is

Re: [R] Reading oxmetrics/pcgive files (.in7 .bn7)

2015-01-27 Thread John C Frain
It is a long time since I have used oxmetrics/pcgive files. The data on the file is in binary form and I do not know of any program that decodes it. The easiest way to transform the dat would be to find a person who had access to one of the oxmetrics oxmetrics programs who would read the file and

Re: [R] create new matrices with specific patterns

2015-01-27 Thread JSHuang3181
Hi, It appears that you want B to be rows 1 thru 4, 6 thru 9, 11 thru 14 and 16 thru 17 from A. B - A[c(1:4, 6:9, 11:14, 16:17),] E - A[16:19,] -- View this message in context: http://r.789695.n4.nabble.com/create-new-matrices-with-specific-patterns-tp4702350p4702354.html Sent from the R

Re: [R] create new matrices with specific patterns

2015-01-27 Thread Jim Lemon
Hi Kathryn, Selecting the elements of matrix A as you describe is not too difficult: select_A-function(A,B) { thisA-A[A[,1] == B$p[1],] newmat-matrix(c(rep(p[1],B$nq[1]),rep(thisA[,2],length.out=B$nq[1])),ncol=2) for(i in 2:dim(B)[1]) { thisA-A[A[,1] == B$p[i],] newmat- rbind(newmat,

Re: [R] Sum function and missing values --- need to mimic SAS sum function

2015-01-27 Thread Hervé Pagès
Hi Martin, On 01/26/2015 04:45 AM, Martin Maechler wrote: Jim Lemon drjimle...@gmail.com on Mon, 26 Jan 2015 11:21:03 +1100 writes: Hi Allen, How about this: sum_w_NA-function(x) ifelse(all(is.na(x)),NA,sum(x,na.rm=TRUE)) Excuse, Jim, but that's yet another horrible misuse

Re: [R-es] Ajuste con exponencial

2015-01-27 Thread Carlos J. Gil Bellosta
Hola, ¿qué tal? Creo que el ajuste (por máxima verosimilitud) de lambda es el inverso de la media de tus datos. Tu densidad en el intervalo de interés es como la de la exponencial (dividida por una constante de normalización). El logaritmo de la verosimitud es, por lo tanto, como el de la

Re: [R] panel.xyplot and panel.loess using two different groupings

2015-01-27 Thread Timothy W. Hilton
Thanks, Bert, for the reply. This is very helpful. I have to admit I've read the docs for the panel and panel.groups arguments before and gotten myself pretty confused. Your small example is very helpful. One more question for the list... Bert's panel.loess col='darkblue' argument is being

Re: [R] panel.xyplot and panel.loess using two different groupings

2015-01-27 Thread Bert Gunter
1. The trellis.par.get$superpose.line list controls the loess line appearance, I believe (check this!) 2. To control the overall loess curve in the panel, call it without the ... arguments, e.g panel.loess(x,y, col.line=darkblue) You may have to modify argument lists appropriately if you want

Re: [R] Reading oxmetrics/pcgive files (.in7 .bn7)

2015-01-27 Thread Mikael Olai Milhøj
Hi John This was really helpful! Exactly what I needed. Thank you very much - I really appreciate it! /Mikael On Tue, Jan 27, 2015 at 11:54 PM, John C Frain fra...@gmail.com wrote: By way of an example, the ox code below reads the sample data.in7 (and data.bn7) distributed with the console

Re: [R] How to add error bars to a line xyplot (lattice package)

2015-01-27 Thread Kevin Wright
See segplot in the latticeExtra package. Kevin On Mon, Jan 26, 2015 at 7:58 PM, Jun Shen jun.shen...@gmail.com wrote: Dear list, I have a couple of lines (superimposed) in an xyplot and just want to add error bars to each of the data point. It's been a while since this question was asked

Re: [R] How to add error bars to a line xyplot (lattice package)

2015-01-27 Thread Bert Gunter
Well, the OP already referred to segplot. But, see, he shouldn't be doing this plot in the first place. Yes, I know it's fairly standard in science, but it's a bad idea (as are many others, like the infamous dynamite plot). If uncertainty intervals are desired, they should be model based,

Re: [R] panel.xyplot and panel.loess using two different groupings

2015-01-27 Thread Timothy W. Hilton
Thanks again, Bert, for taking the time to respond to my questions. It's doing exactly what I want now. I'm fairly new with lattice plots but they do seem like a big step forward. I'll look for Deepayan's book; thanks for the tip. -Tim On Tue, Jan 2015, 27 at 02:11:33PM -0800, Bert Gunter

Re: [R] Reading oxmetrics/pcgive files (.in7 .bn7)

2015-01-27 Thread John C Frain
By way of an example, the ox code below reads the sample data.in7 (and data.bn7) distributed with the console version of Ox and outputs it as an Excel file. #include oxstd.h #import database main() { decl dbase; dbase = new Database(); dbase.Load(C:\Program Files

Re: [R] Sum function and missing values --- need to mimic SAS sum function

2015-01-27 Thread Bert Gunter
Huh?? ifelse(TRUE, a - 2L, a - 3L) [1] 2 a [1] 2 Please clarify. -- Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 Data is not information. Information is not knowledge. And knowledge is certainly not wisdom. Clifford Stoll On Mon, Jan 26, 2015 at 2:22 PM, Hervé

Re: [R] read.table - replaces 'T' with 'TRUE'

2015-01-27 Thread Brian Smith
Thanks!! On Mon, Jan 26, 2015 at 5:23 PM, peter dalgaard pda...@gmail.com wrote: On 26 Jan 2015, at 23:10 , Duncan Murdoch murdoch.dun...@gmail.com wrote: read.table(other args as before, colClasses = character) (You might want factor instead of character.) Or maybe not. I'd expect

[R] Problems installing jpeg package

2015-01-27 Thread Jorge Fernández García
I need help installing jpeg package. Simple command install.package(jpeg) produce the following result. My OS is Fedora 21. Thanks in advance for your help. install.packages(jpeg) Installing package into �/home/cgg/R/x86_64-redhat-linux-gnu-library/3.1� (as �lib� is unspecified) trying URL

[R] How to filter a data frame with user defined function?

2015-01-27 Thread Monnand
Hi all, This really annoyed since I thought this would be easy with some higher order function. Here is what I want: I have a data frame with two columns, one is ID, another one is Name. I want to get all rows whose name starts with some specific prefix. I thought this should be a one-liner

Re: [R] k paths from a single vertex

2015-01-27 Thread Boris Steipe
Does the igraph function neighborhood() not do what you need? B. On Jan 27, 2015, at 7:22 AM, Manon Lily Ragonnet-cronin manon.ragon...@ed.ac.uk wrote: Dear all, I am analysis networks using both igraph and network/ sna packages. I want to find all the nodes within 3 steps of a specific

Re: [R] Problems installing jpeg package

2015-01-27 Thread Marc Schwartz
On Jan 27, 2015, at 6:05 AM, Jorge Fernández García jorfeg...@hotmail.com wrote: I need help installing jpeg package. Simple command install.package(jpeg) produce the following result. My OS is Fedora 21. Thanks in advance for your help. install.packages(jpeg) Installing package

Re: [R-es] microsoft R

2015-01-27 Thread miguel.angel.rodriguez.muinos
Una forma rápida de subirse al carro del Big Data Esperemos a ver. -Mensaje original- De: R-help-es [mailto:r-help-es-boun...@r-project.org] En nombre de Marcuzzi, Javier Rubén Enviado el: domingo, 25 de enero de 2015 2:21 Para: r-help-es@r-project.org Asunto: [R-es] microsoft R Hola

Re: [R] Sum function and missing values --- need to mimic SAS sum function

2015-01-27 Thread Sven E. Templer
Maybe this is due to the usage of rep() in ifelse(): f.rep - function(ans){ans - rep(ans,1);return(ans)} f - function(ans){return(ans)} f(a - 123) # no print here f.rep(a - 123) # prints: # [1] 123 On 27 January 2015 at 11:54, Bert Gunter gunter.ber...@gene.com wrote: Huh?? ifelse(TRUE, a -

Re: [R] How to add error bars to a line xyplot (lattice package)

2015-01-27 Thread William Revelle
You might want to look at the examples in error.bars.by in the psych package. Bill On Jan 26, 2015, at 7:58 PM, Jun Shen jun.shen...@gmail.com wrote: Dear list, I have a couple of lines (superimposed) in an xyplot and just want to add error bars to each of the data point. It's been a

[R] k paths from a single vertex

2015-01-27 Thread Manon Lily Ragonnet-cronin
Dear all, I am analysis networks using both igraph and network/ sna packages. I want to find all the nodes within 3 steps of a specific node but cannot find a function to do this. I know that kpath.census can generate tables for the entire network but my network is too large for this to be