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

warning about invalid .internal.selfref detected on a data.tabe in a list #1908

Closed
maverickg opened this Issue Nov 10, 2016 · 6 comments

Comments

Projects
None yet
4 participants
@maverickg

maverickg commented Nov 10, 2016

Not sure this is a bug, but I am not expecting this warning. The following is how to replicate:

library(data.table)
dt <- data.table(x=rexp(100),y=rep(LETTERS[1:10], 10))
dtL <- split(dt, by = "y")
dtL[[1]][, x2 := -x]
Warning message:
In `[.data.table`(dtL[[1]], , `:=`(x2, -x)) :
  Invalid .internal.selfref detected and fixed by taking a (shallow) copy of the data.table 
so that := can add this new column by reference. At an earlier point, this data.table 
has been copied by R (or been created manually using structure() or similar). 
Avoid key<-, names<- and attr<- which in R currently (and oddly) may copy 
the whole data.table. Use set* syntax instead to avoid copying: ?set, ?setnames
 and ?setattr. Also, in R<=v3.0.2, list(DT1,DT2) copied the entire DT1 
and DT2 (R's list() used to copy named objects); please upgrade to 
R>v3.0.2 if that is biting. If this message doesn't help, please report 
to datatable-help so the root cause can be fixed.

By the way, I am using R 3.3.1 and the most recent data.table by following here https://github.com/Rdatatable/data.table/wiki/Installation

@MichaelChirico

This comment has been minimized.

Show comment
Hide comment
@MichaelChirico

MichaelChirico Nov 10, 2016

Contributor

have you searched at all?

the trouble of data.tables in lists is well-reported. there are I think
several outstanding issues. see here for a start

http://stackoverflow.com/q/17133522/3576984

On Nov 10, 2016 10:48 AM, "maverickg" notifications@github.com wrote:

Not sure this is a bug, but I am not expecting this warning. The following
is how to replicate:

library(data.table)
dt <- data.table(x=rexp(100),y=rep(LETTERS[1:10], 10))
dtL <- split(dt, by = "y")
dtL[[1]][, x2 := -x]
Warning message:
In [.data.table(dtL[[1]], , :=(x2, -x)) :
Invalid .internal.selfref detected and fixed by taking a (shallow) copy of the data.table
so that := can add this new column by reference. At an earlier point, this data.table
has been copied by R (or been created manually using structure() or similar).
Avoid key<-, names<- and attr<- which in R currently (and oddly) may copy
the whole data.table. Use set* syntax instead to avoid copying: ?set, ?setnames
and ?setattr. Also, in R<=v3.0.2, list(DT1,DT2) copied the entire DT1
and DT2 (R's list() used to copy named objects); please upgrade to
R>v3.0.2 if that is biting. If this message doesn't help, please report
to datatable-help so the root cause can be fixed.

By the way, I am using R 3.3.1 and the most recent data.table by following
here https://github.com/Rdatatable/data.table/wiki/Installation


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#1908, or mute the thread
https://github.com/notifications/unsubscribe-auth/AHQQdcqakAtnYt4m8Rpd5j42x3_g2Bghks5q8zy0gaJpZM4Kuz7N
.

Contributor

MichaelChirico commented Nov 10, 2016

have you searched at all?

the trouble of data.tables in lists is well-reported. there are I think
several outstanding issues. see here for a start

http://stackoverflow.com/q/17133522/3576984

On Nov 10, 2016 10:48 AM, "maverickg" notifications@github.com wrote:

Not sure this is a bug, but I am not expecting this warning. The following
is how to replicate:

library(data.table)
dt <- data.table(x=rexp(100),y=rep(LETTERS[1:10], 10))
dtL <- split(dt, by = "y")
dtL[[1]][, x2 := -x]
Warning message:
In [.data.table(dtL[[1]], , :=(x2, -x)) :
Invalid .internal.selfref detected and fixed by taking a (shallow) copy of the data.table
so that := can add this new column by reference. At an earlier point, this data.table
has been copied by R (or been created manually using structure() or similar).
Avoid key<-, names<- and attr<- which in R currently (and oddly) may copy
the whole data.table. Use set* syntax instead to avoid copying: ?set, ?setnames
and ?setattr. Also, in R<=v3.0.2, list(DT1,DT2) copied the entire DT1
and DT2 (R's list() used to copy named objects); please upgrade to
R>v3.0.2 if that is biting. If this message doesn't help, please report
to datatable-help so the root cause can be fixed.

By the way, I am using R 3.3.1 and the most recent data.table by following
here https://github.com/Rdatatable/data.table/wiki/Installation


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#1908, or mute the thread
https://github.com/notifications/unsubscribe-auth/AHQQdcqakAtnYt4m8Rpd5j42x3_g2Bghks5q8zy0gaJpZM4Kuz7N
.

@maverickg

This comment has been minimized.

Show comment
Hide comment
@maverickg

maverickg Nov 10, 2016

no, but the warning does not make sense as I am using a function (that is, split) provided by data.table to generate the list. And this warning does not provide any help on how to fix it.

maverickg commented Nov 10, 2016

no, but the warning does not make sense as I am using a function (that is, split) provided by data.table to generate the list. And this warning does not provide any help on how to fix it.

@jangorecki jangorecki self-assigned this Nov 10, 2016

@jangorecki

This comment has been minimized.

Show comment
Hide comment
@jangorecki

jangorecki Nov 10, 2016

Member

@maverickg thanks for reporting, it is now fixed. If all tests will pass it should published in our repository in around 10-15 minutes.

Member

jangorecki commented Nov 10, 2016

@maverickg thanks for reporting, it is now fixed. If all tests will pass it should published in our repository in around 10-15 minutes.

@jangorecki jangorecki added the bug label Nov 10, 2016

@maverickg

This comment has been minimized.

Show comment
Hide comment
@maverickg

maverickg Nov 10, 2016

that is fast! cool! @jangorecki thanks a lot.

maverickg commented Nov 10, 2016

that is fast! cool! @jangorecki thanks a lot.

@parisagavanji

This comment has been minimized.

Show comment
Hide comment
@parisagavanji

parisagavanji Jun 30, 2018

Hi
I got the same warning when I was trying package "simPop" in R. Could anyone help me?
I wanted to install data.table package but I could not.

parisagavanji commented Jun 30, 2018

Hi
I got the same warning when I was trying package "simPop" in R. Could anyone help me?
I wanted to install data.table package but I could not.

@jangorecki

This comment has been minimized.

Show comment
Hide comment
@jangorecki

jangorecki Jun 30, 2018

Member

@parisagavanji please create new issue and provide minimal reproducible example, using latest data.table version. For installing data.table see Installation wiki page.

Member

jangorecki commented Jun 30, 2018

@parisagavanji please create new issue and provide minimal reproducible example, using latest data.table version. For installing data.table see Installation wiki page.

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