Re: [R] How to capture the expression corresponding to the i param in the [ function

2013-05-16 Thread Nhan Vu Lam Chi
Sorry David for this belate thank. Your code helped me so much. I tested a class that does not inherit the data.frame class and it also worked. Maybe I had problems with different kinds of method signatures of [ function. For example, this does not work: setMethod("[", signature(x="BigDataFrame", j

Re: [R] How to capture the expression corresponding to the i param in the [ function

2013-05-14 Thread David Winsemius
On May 14, 2013, at 8:02 PM, David Winsemius wrote: I think you need to read ?setClass and ?setMethod. There is an example of defining a "[" method for a class that inherits from 'data.frame'. I suspect you need to capture the various possibilities for the arguments being present or missin

Re: [R] How to capture the expression corresponding to the i param in the [ function

2013-05-14 Thread David Winsemius
I think you need to read ?setClass and ?setMethod. There is an example of defining a "[" method for a class that inherits from 'data.frame'. I suspect you need to capture the various possibilities for the arguments being present or missing. -- David Sent from my iPhone On May 14, 2013, at 5:

Re: [R] How to capture the expression corresponding to the i param in the [ function

2013-05-14 Thread Nhan Vu Lam Chi
Dear David, First, I would like to say thank you for your very soon reply. Second, I want to clarify the question because it seems to not carrying exactly what I want to ask. Let take an example on R data.frame: V1 <- 1 df2 <- df[V1== 1,] # df is a data.frame, this command is correct, right? The

Re: [R] How to capture the expression corresponding to the i param in the [ function

2013-05-13 Thread David Winsemius
On May 13, 2013, at 6:38 PM, Nhan Vu Lam Chi wrote: > Hi everyone, > I currently work on a S4 class that has the [ function. I want to capture > the unevaluated expression corresponding to the i param using substitute() > function and do a non-standard evaluation. However R automatically > evalua

[R] How to capture the expression corresponding to the i param in the [ function

2013-05-13 Thread Nhan Vu Lam Chi
Hi everyone, I currently work on a S4 class that has the [ function. I want to capture the unevaluated expression corresponding to the i param using substitute() function and do a non-standard evaluation. However R automatically evaluates the expression and give me its value. For example: Given myd