I will complement the reply given by @Márcio Mocellin on the second topic:
how to eliminate this object?
As quoted by @Tomás Barcellos in the comments:
rm(list = ls(all.names = TRUE))
ls(all.names = TRUE)
And, what implications may occur if removed?
I did two tests to verify the existence of possible problems regarding this:
first, I eliminated .Random.seed
;
second, I applied two functions that generate and define random number patterns (I applied sample
and set.seed
, respectively).
sample
worked properly. And, interestingly, .Random.seed
was activated, returning to globalenv()
. To prove this:
#Eliminar .Random.seed do globalenv()
rm(list = ls(all.names = TRUE))
ls(all.names = TRUE)
#character(0)
#Aplicação da função
x<-sample(1:10,10,replace=T)
#[1] 44 39 27 17 10 17 49 49 5 21
#Reaparecimento da função .Random.seed ao globalenv()
ls(all.names = TRUE)
#[1] ".Random.seed" "x"
When using the function set.seed
, .Random.seed
is also activated and returns to globalenv()
:
#Eliminar .Random.seed do globalenv()
rm(list = ls(all.names = TRUE))
ls(all.names = TRUE)
#character(0)
#Aplicação da função
set.seed(456)
#Reaparecimento da função .Random.seed ao globalenv()
ls(all.names = TRUE)
[1] ".Random.seed"
- This was an empirical, test-based response. I cannot say if there is any situation in which the removal of
.Random.seed
is harmful. Only theory can say this. Unfortunately, I found nothing (reliable) about.
What a breeze. Good question!
– Tomás Barcellos
But you can delete yes. Enough
rm(list = ls(all.names = TRUE))
. After that,ls(all.names = TRUE)
results incharacter(0)
.– Tomás Barcellos
Another interesting question is why he’s in
.GlobalEnv
. Other hidden objects such as.Library
stay in thebase
, for example.– Tomás Barcellos
I edited the question based on your comment.
– neves