Can anyone explain to me why the following example occurs?
#Create simple dataframe
assign( \"df\" , data.frame( P = runif(5) , Q = runif(5) , R = runif(5) )
Using assign in the way you demonstrate in the question is at least uncommon in R. Normally you would just put all objects in a list.
So, instead of
for (i in 1:10) {
assign( paste( "Object" , i , sep = "." ) , rnorm(1000 , i) )}
you would do
objects <- list()
for (i in 1:10) {
objects[[i]] <- rnorm(1000 , i) }
In fact, this construct is so common that there is a (optimized) function (lapply), which does something similar:
objects <- lapply(1:10, function(x) rnorm(1000,x))
You can then access, e.g., the first object as objects[[1]] and there are several functions for working with lists.