[R] Help with the generic function "["

2008-01-14 Thread Gregory Wall
Hello Everyone: I'm hoping to get some suggestions on this problem i'm having with subsetting on an R object i've created. I would really appreciate any advice. I've created this simple S3 class: >str(ans) Class 'myObj' atomic [1:45000] 0.0428 0.0423 0.0554 0.0338 0.0345 ... ..- attr(*, "Si

[R] Subsetting Method [ Revisited

2008-01-09 Thread Gregory Wall
Hello Everyone: As usual, thanks in advance for any help. I was hoping to get some more advice on this question: I'm trying to write a subsetting routine for an S3 object I've created -- lets call it myObject. myObject has a few attributes basically of type string and numerics. Its atomic va

[R] if ( expr )

2007-11-20 Thread Gregory Wall
Hello, I've searched the list but haven't found anything really applicable to my question. Any advice would be super. I'm working on a snippet of R code and I have a function with a prototype like this: foo <- function( x, ... ){ if( is.na(x)[1] ) {etc...} } Where x is typically a vector