I'll let Bill respond in detail if he cares to(he is both more
knowledgable and fluent at this than I), but as a nearly unbreakable
rule, get() and assign() should not be used in R. Basically, they
represent a macro (script)-oriented strategy for handling R's objects,
whereas R is designed to use a
Dear all,
Provided I understood correctly, shouldn't assign() do the trick? Most similar
threads seem to include this approach (among others, indeed).
Regards,
Bastien
On Wednesday, July 8, 2015 at 7:30:04 PM UTC+2, William Dunlap wrote:
> You can use an environment instead of a list using the
Yes, assign() and get() can do this, but I think the [[]] syntax is simpler
and makes it easier to switch between lists and environments for
data organization.
E.g., the translation of
myData[[varName]][4] <- myData[[varName]][4] * 100
where myData is an environment to the get/assign style
woul
You can use an environment instead of a list using the same [[ syntax. It
is like 'get0(..., inherit=FALSE)' on the left side of the <- and like
'assign(...)' on the right side. E.g.,
myData <- new.env()
varName <- "v1"
myData[[varName]] <- 1:10
myData[[varName]][4] <- myData[[varNam
This is FAQ 7.21.
The most important part of the answer in FAQ 7.21 is the last section
where it states that it is often easier to use a list rather than
messing around with trying to dynamically name global variables.
If you tell us what you are trying to accomplish then we may have
better advic
Try reading the Help files before posting here. That's what they're for.
?get
provides the answer in a note in the Help page.
Cheers,
Bert
Bert Gunter
"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
-- Clifford Stoll
On Tue, Jul 7, 2015 at
6 matches
Mail list logo