पर्यावरण में किसी नाम को मान निर्दिष्ट करने और चर के वातावरण को सेट करने के बीच क्या अंतर है? मैं इसे दस्तावेज़ीकरण से नहीं समझ सका।असाइनमेंट के बीच अंतर (..., envir = ...) और पर्यावरण (...) =
उदाहरण के लिए:
MyTestFunc = function(x)
{
myVal = "abcde"
# what is this doing? why is myVal not in the global environment after
# this call? I see it adds an environment attribute to the variable,
# but what good is that?
environment(myVal) = globalenv()
assign("myVal" , myVal , envir = globalenv())
# this seems to copy graphics:::rect to the current environment which seems
# to contradict the behavior of environment(myVal) above
environment(rect) = environment()
# this seems to do the same thing
assign("rect" , rect , envir = globalenv())
}
# this prints out rect, but shows <environment: namespace: graphics>!
rect
सुपर स्पष्ट उत्तर के लिए धन्यवाद! – SFun28