Re: [R] Referencing a column using a function argument

2011-07-27 Thread Eik Vettorazzi
Hi, use tableName[["columnName"]] without quotes, e.g. tableName[[columnName]] # see ?"[[" and indexing is done via x<-length(tableName[[columnName]][tableName[[columnName]] > 6] ) but you may consider x<-sum(tableName[[columnName]]>6) which saves some time and typing Hth. Am 27.07.2011 17:2

[R] Referencing a column using a function argument

2011-07-27 Thread Lin, YunHui
Hi all, I've been having trouble with something that seems like it should be fairly straight forward. Any help at all from more experienced users is appreciated! I'd like to write a function that uses a column name as an argument. However, I run into problems when I try to reference this colum