I am not quite sure why the data frame object does not update

```
d <- data.frame(titi=c(0))
(function(dataset) {
  dataset[["toto"]] <- 1;
  print(names(dataset)) #has "toto" and "titi"
})(d)
print(names(d)) # no has "toto", only "titi" 

```

What is going on here ?

I have a workaround as in my code I also capture the variable and update the captured with `<<-`, but I'd like to know the mechanism.

I am aware of the danger of mutation in general etc.. I just dont understand the mechanism at play here. 

**Edit**

Although it seems to be the consensus that this is a language level feature, I dont follow the argument, as if I use a close structure, the data table, it **can** mutate :

```
d <- data.table(titi=c(0))
(function(dataset) {
  dataset[,toto:=1]
  print(names(dataset)) #"titi" "toto"
})(d)
print(names(d)) #"titi" "toto"

```