Использование get () с функциями замены
Может кто-нибудь объяснить мне, почему происходит следующий пример?
#Create simple dataframe
assign( "df" , data.frame( P = runif(5) , Q = runif(5) , R = runif(5) ) )
#Return the dataframe from the given character vector
get( "df" )
P Q R
1 0.17396222 0.90994676 0.90590685
2 0.33860092 0.98078739 0.38058921
3 0.80751402 0.93229290 0.82853094
4 0.05460417 0.55448507 0.01605027
5 0.04250316 0.03808318 0.40678270
#Return the column names of df
colnames( get( "df" ) )
[1] "P" "Q" "R"
#But using a replacement function...
colnames( get( "df" ) )