[R] Inconsistency in representation of variables

Stavros Macrakis macrakis at alum.mit.edu
Mon May 11 16:30:58 CEST 2009

In stats::D, I was wondering why variables are represented as symbols
in expressions, but as strings in lists of variables:

    D(quote(x^2),"x") => 2*x
    D(quote(x^2),quote(x)) => error Variable must be a character string

Strings are not allowed in the expression to denote variables:

    D(quote("x"),quote("x")) == D("k","x") => NA  (why not an error?)


More information about the R-help mailing list