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
Labels
feature request programming parameterizing queries: get, mget, eval, env

Comments

@arunsrinivasan
Copy link
Member

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 modified the milestones: v1.9.6, v1.9.4 Sep 27, 2014
@arunsrinivasan arunsrinivasan modified the milestones: v1.9.6, v1.9.8 Oct 10, 2014
@mattdowle
Copy link
Member

@JoshOBrien
Copy link
Contributor

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).

@RuinedSubmartingale
Copy link

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 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

Refer to #2186 for name mention under NEWS.

@franknarf1
Copy link
Contributor

Another SO post: https://stackoverflow.com/q/45387223/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request programming parameterizing queries: get, mget, eval, env
Projects
None yet
Development

No branches or pull requests

7 participants