It is legal to call a variable by a name that begins with a dot (like .identifier
). However, within()
function does not preserve them. Did I miss something? Or is it a bug?
A <- data.frame(.has.a.dot=1:10,has.no.dot=letters[1:10])
within(A, new.variable<-rnorm(10,.has.a.dot))
gives :
has.no.dot new.variable
1 a 1.300361
2 b 3.014026
3 c 2.354260
4 d 4.261637
5 e 5.159326
6 f 7.178712
7 g 6.438039
8 h 8.253819
9 i 9.463351
10 j 8.828403