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

unwanted memory "sharing" with names() on a data.table #777

Closed
vsalmendra opened this issue Aug 21, 2014 · 3 comments
Closed

unwanted memory "sharing" with names() on a data.table #777

vsalmendra opened this issue Aug 21, 2014 · 3 comments

Comments

@vsalmendra
Copy link

It seems that the variable created by using names() on a data.table keeps pointing to the data.table internal data, so when one renames a field, the variable which holds the names() results also changes. I suspect this is behind other crashes with data.table I have been experiencing

> x = data.table(a=c(1,2), b=c(2,3))
> n = names(x)
> setnames(x, "a","z")
> x
   z b
1: 1 2
2: 2 3
> n
[1] "z" "b"

Version info:

data.table v 1.9.2
platform x86_64-pc-linux-gnu
arch x86_64
os linux-gnu
system x86_64, linux-gnu
status
major 3
minor 1.0
year 2014
month 04
day 10
svn rev 65387
language R
version.string R version 3.1.0 (2014-04-10)
nickname Spring Dance

@jangorecki
Copy link
Member

Just to let you know you should report an issue after checking it on current dev 1.9.3. It may have been fixed already, 1.9.2 is quite old already. Cheers

@arunsrinivasan
Copy link
Member

Thanks. We're aware of this - duplicate of #512. You should use copy().
I'd be interested to know more about the other crashes you're experiencing.

@vsalmendra
Copy link
Author

Error in if (!all(names(sys.call()) %in% c("", "exact")))
warning("named arguments other than 'exact' are discouraged") :
missing value where TRUE/FALSE neededError during wrapup: missing
value where TRUE/FALSE neededError in if (!is.null(ns)) ns else
tryCatch(loadNamespace(name), error = function(e) stop(e)) :
missing value where TRUE/FALSE needed

2014-08-21 18:09 GMT+03:00 arunsrinivasan notifications@github.com:

Thanks. We're aware of this - duplicate of #512
#512. You should use
copy().
I'd be interested to know more about the other crashes you're
experiencing.


Reply to this email directly or view it on GitHub
#777 (comment)
.

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

3 participants