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
@arunsrinivasan arunsrinivasan added the High label 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
@arunsrinivasan arunsrinivasan modified the milestones: v2.0.0, v1.9.8 Mar 20, 2016
mattdowle added a commit that referenced this issue Dec 8, 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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants
You can’t perform that action at this time.