Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[R-Forge #2110] Add . and .. symbol prefixes and inherits=FALSE for strict scope #633

Open
arunsrinivasan opened this issue Jun 8, 2014 · 6 comments

Comments

@arunsrinivasan
Copy link
Member

@arunsrinivasan arunsrinivasan commented Jun 8, 2014

Submitted by: Matt Dowle; Assigned to: Nobody; R-Forge link

inherits=FALSE would allow user to specify that j should use column names only, and if column name doesn't exist that should be error rather than possibly finding a match in calling scope.

..() is for the sub-join examples where the join goes in j and you want to refer to the columns in i not .SD. Something like that.

@mattdowle mattdowle changed the title [R-Forge #2110] Add .(), ..(), inherits=FALSE and maybe . and .. prefixes to symbols [R-Forge #2110] Add . and .. symbol prefixes and inherits=FALSE for strict scope Jun 17, 2014
@arunsrinivasan arunsrinivasan added this to the v1.9.4 milestone Jul 31, 2014
@mattdowle mattdowle added this to the v1.9.6 milestone Sep 27, 2014
@mattdowle mattdowle removed this from the v1.9.4 milestone Sep 27, 2014
@arunsrinivasan arunsrinivasan removed this from the v1.9.6 milestone Oct 10, 2014
@arunsrinivasan arunsrinivasan added this to the v1.9.8 milestone Oct 10, 2014
@arunsrinivasan arunsrinivasan added this to the v1.9.8 milestone Oct 10, 2014
@arunsrinivasan arunsrinivasan removed this from the v1.9.6 milestone Oct 10, 2014
@mattdowle
Copy link
Member

@mattdowle mattdowle commented Dec 3, 2015

@arunsrinivasan arunsrinivasan added this to the v2.0.0 milestone Mar 20, 2016
@arunsrinivasan arunsrinivasan removed this from the v1.9.8 milestone Mar 20, 2016
@JoshOBrien
Copy link
Contributor

@JoshOBrien JoshOBrien commented Jan 19, 2017

Once version 10.2 is released (if not before), we should revisit this answer to remove the mention of datatable.WhenJisSymbolThenCallingScope=TRUE. (As always, any of you should feel free to edit as you like).

@Synergist
Copy link

@Synergist Synergist commented Feb 11, 2017

It'd be nice to be able to use this feature and the ! notation for excluding columns in tandem.

dt <- data.table(x = 1:10, y = rnorm(10), z = runif(10))
cols <- c('y', 'z')
dt[, !..cols] # should return col x

@ctbrown
Copy link

@ctbrown ctbrown commented Jun 20, 2017

I followed the SO issue here looking for this feature. Since, it is still experimental may I recommend that the syntax be changed from ..A to ..$A where .. is a reference to the parent.frame. I believe this is more R-like, does the same thing and conforms to user expectations. It seems that this can be simply(?) done with:

makeActiveBinding('..', parent.frame)

@arunsrinivasan
Copy link
Member Author

@arunsrinivasan arunsrinivasan commented Jun 29, 2017

Refer to #2186 for name mention under NEWS.

@franknarf1
Copy link
Contributor

@franknarf1 franknarf1 commented Jul 29, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants