[R] deparse, substitute and S4 generics

2008-01-22 Thread Bojanowski, M.J. (Michal)
Hello everyone, I encountered the following confusing behavior of 'deparse' and 'substitute' while programming with S4 classes (see example below). It seems like the presence of '...' argument in the definition of the generic generates the problem. I have no clue why, can anyone explain that to me

[R] Adding a table to a lattice plot

2008-01-22 Thread Judith Flores
Hi, Is there an analog function of textplot in the lattice package? I need to add a data frame to a lattice plot. I work in a Windows environment and I am using R v 2.6.1 Thank you, Judith Be a bette

Re: [R] deparse, substitute and S4 generics

2008-01-22 Thread Bill.Venables
Try putting a ... argument in the method for g as well setGeneric("g", function(object, ...) standardGeneric("g")) setMethod("g", "ANY", function(object, ...) ### change { nam <- deparse(substitute(object)) cat("name:", nam, "\n") object } ) Now it works. Bill Venables CSIRO Labo

[R] install ncdf package on a 64-bit machine

2008-01-22 Thread Linda Smith
Dear All, I recently got a 64bit machine and had netcdf-3.6.2 installed. Then I tried to install ncdf package but got the following error message when using netcdflib: gcc -std=gnu99 -I/home/ljin/share/R-2.6.1/include -I/home/ljin/share/R-2.6.1/include -I. -I/usr/local/include-fpic -g -O2 -c

Re: [R] Adding a table to a lattice plot

2008-01-22 Thread Deepayan Sarkar
On 1/22/08, Judith Flores <[EMAIL PROTECTED]> wrote: > Hi, > >Is there an analog function of textplot in the > lattice package? I need to add a data frame to a > lattice plot. I work in a Windows environment and I am > using R v 2.6.1 There's nothing built-in, but if you are happy with fixed w

Re: [R] deparse, substitute and S4 generics

2008-01-22 Thread Michał Bojanowski
Hello Bill, Thanks! Indeed that works. Can you give me a hunch why? Does it have anything to do with environments and scope? ~michal Bill.Venables wrote: > > Try putting a ... argument in the method for g as well > > setGeneric("g", function(object, ...) standardGeneric("g")) > > setMethod

Re: [R] Reading .csv file under linux

2008-01-22 Thread Peter Dalgaard
David Scott wrote: > I am a total dunce when it comes to encodings though. How do you find the > encoding of a file? > You don't. Either you know it, or you are up the proverbial creek (or roof). The "8-bit ascii" encodings is one of the greater computer crimes of the last century precisely b

Re: [R] recoding one variable into another - but differently for different cases

2008-01-22 Thread hadley wickham
No one else mentioned this, but if those 99s represent missings, you should be using NA not a special numeric value. Hadley On Jan 22, 2008 5:40 PM, Dimitri Liakhovitski <[EMAIL PROTECTED]> wrote: > Thanks a lot, everyone! > Dimitri > > > On 1/22/08, Gabor Grothendieck <[EMAIL PROTECTED]> wrote:

Re: [R] recoding one variable into another - but differently for different cases

2008-01-22 Thread Rolf Turner
On 23/01/2008, at 2:02 PM, hadley wickham wrote: > No one else mentioned this, but if those 99s represent missings, you > should be using NA not a special numeric value. Amen, bro. Using ``99'' to represent a missing value is a heinous, if all too often inflicted, crime against

Re: [R] a Q about R in unix

2008-01-22 Thread Wensui Liu
Any insight? I really appreciate your input. wensui On 1/22/08, Wensui Liu <[EMAIL PROTECTED]> wrote: > Dear All, > I finally have chance to have R install on our unix server. However, > the system admin asked me if I prefer command-line or gui interface. > I have experience with R on linux befor

[R] How to do more advanced cross tabulation in R?

2008-01-22 Thread tom soyer
Hi, I am trying to reproduce some functionalities of Excel pivot table in R, sadly, I couldn't figure out how to do it. I am wondering if this is even possible in R. Does anyone know? Here is an example: year=rep(2003,16) quarter=rep(1:4,each=4) sales=1:16 company=rep(c("a","b","c","d"),4) df=da

Re: [R] deparse, substitute and S4 generics

2008-01-22 Thread Martin Morgan
Michal -- setMethod creates a nested function named .local when method arguments do not match generic arguments. This changes the environment in which deparse(substitute()) evaluates, and probably is a significant warning flag about using these types of idioms with S4. Creating .local is meant I

Re: [R] How to do more advanced cross tabulation in R?

2008-01-22 Thread Gabor Grothendieck
I think you are looking for ftable: xt <- xtabs(sales ~ company + year + quarter, data = DF) ftable(quarter ~ year + company, xt) You also might want to look at the reshape package and the rpad package. Here is a demo of a pivot table in R using rpad for the user interface and reshape for the da

Re: [R] How to do more advanced cross tabulation in R?

2008-01-22 Thread Charles C. Berry
On Tue, 22 Jan 2008, tom soyer wrote: > Hi, > > I am trying to reproduce some functionalities of Excel pivot table in R, > sadly, I couldn't figure out how to do it. I am wondering if this is even > possible in R. Does anyone know? > Using 'ftable()', I can match your format, but the cell values

Re: [R] install ncdf package on a 64-bit machine

2008-01-22 Thread Katharine Mullen
I am running 64-bit Ubuntu 7.10 and unfortunately remember seeing that error message but not how I got it to go away. I would first try compiling netcdf-3.6.2 from source, without changing the default directories for installation. Looking at the error message it seems like the 3 shared librarie

Re: [R] How to do more advanced cross tabulation in R?

2008-01-22 Thread tom soyer
Thanks Charles and Gabor! Sorry Charles, the numbers were wrong in my example. You had the correct one. On 1/22/08, Charles C. Berry <[EMAIL PROTECTED]> wrote: > > On Tue, 22 Jan 2008, tom soyer wrote: > > > Hi, > > > > I am trying to reproduce some functionalities of Excel pivot table in R, > > s

Re: [R] recoding one variable into another - but differently for different cases

2008-01-22 Thread Gabor Grothendieck
Note that if you do use NA rather than 99 as others have suggested then the A==4 term should use ifelse rather than multiplication since 0 * NA = NA, not 0: transform(Data, new = (A == 1) * ((B == 1) - (B == 2)) + (A == 2) * ((B == 2) - (B ==1)) + ifelse(A == 4, NA, 0)) In fact, although more

[R] help with levelplot()

2008-01-22 Thread dxc13
useR's, I want to create a "movie" of a sin function (from 0 to pi/2) using levelplot() in the lattice package. I basically want to create 20 or so plots of the sin function starting with an amplitude of 0 and ending at amplitude 1. By using a loop and plotting these in succession, it will have

Re: [R] help with levelplot()

2008-01-22 Thread hadley wickham
On Jan 22, 2008 8:39 PM, dxc13 <[EMAIL PROTECTED]> wrote: > > useR's, > > I want to create a "movie" of a sin function (from 0 to pi/2) using > levelplot() in the lattice package. I basically want to create 20 or so > plots of the sin function starting with an amplitude of 0 and ending at > amplit

Re: [R] extension to nlme self start SSmicmen?

2008-01-22 Thread David Airey
. Just to close the query, here are the data and my R code to use nlme to test for a strain difference in receptor binding using nlme and the self start function SSmicmen. Cheers, Dave "rownames","y","x","strain","pool" "1",1,54.0423393249512,0.169009417295456,"dba","5_10" "2",2,96.19451904

Re: [R] a Q about R in unix

2008-01-22 Thread Don MacQueen
I would suggest that you view unix and linux as being essentially the same, from the point of view of using R. I use ESS for syntax coloring, help with indentation and parentheses matching, that sort of thing, and it works very well. -Don At 11:08 AM -0500 1/22/08, Wensui Liu wrote: >Dear All,

[R] data frame to matrix

2008-01-22 Thread My Coyne
Hello, I have a data frame and would like to convert it into a matrix, how do I do that? Thanks --My Coyne [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

[R] Odp: data frame to matrix

2008-01-22 Thread Petr PIKAL
Hi what about as.matrix(data_frame) Regards Petr Pikal [EMAIL PROTECTED] [EMAIL PROTECTED] napsal dne 23.01.2008 07:38:50: > Hello, > > I have a data frame and would like to convert it into a matrix, how do I do > that? > > > > Thanks > > > > --My Coyne > > > > > > > > > >

Re: [R] data frame to matrix

2008-01-22 Thread mel
My Coyne a écrit : > I have a data frame and would like to convert it into a matrix, how do I do > that? either use the df for the initialisation values mat = matrix(df, ...) or as.matrix() could do the trick. __ R-help@r-project.org mailing list https:

[R] samr error

2008-01-22 Thread My Coyne
I'm running samr (Two class unpaired), but keep getting the following error: perm= 1 Error in if (logged2) { : argument is of length zero library (impute) library (samr) data = list (x=dat, y=y, geneid = matrix(twoUnpaired.data[,1],ncol=1), genenames = matrix(twoUnpaired.data[,2], ncol=1))

<    1   2