I read http://www.cran.r-project.org/doc/manuals/R-lang.pdf chapter 4.3, and I just don't understand. Maybe someone can give me a brief explanation of why R behaves as follows.
fCall <- function(i){ dtData[i] } fSubstituteCall <- function(i){ iSub <- substitute(i) dtData[eval(iSub)] } library(data.table) dtData <- data.table(id=LETTERS, value=1:26) dtData[id == 'C']
Why does fSubstituteCall work and fCall not? Is this related to i? Or is it really something specific for the data.table package?
EDIT:
Thank you for your answers. I kind of understand, and I agree that this is a duplicate of stackoverflow.com/q/14837902/602276. Therefore, I am going to simplify my question.
How to make fPrintArgument print argument i as a string? Therefore, in the case of fCall ('C'), it should print the string 'C', and in fCall (id == 'C') it should print the string 'id ==' C ".
Is it possible?
fPrintArgument <- function(i){
source share