Home > Mobile >  Assigning to a dataset that could only be found through another list
Assigning to a dataset that could only be found through another list

Time:10-11

I have a list of dataset names in a list that does not contain actual datasets themselves. How do I assign to a specific dataset another dataset?

Example:

  • data[1] contains the name of a dataset1.
  • data[2] contains the name of a dataset2.

I want to assign dataset2 to dataset1.

get(data[1]) <- get(data[2]) does not working.

How do I solve the problem?

CodePudding user response:

IF you really, really want to do that you could use assign:

assign(data[1], get(data[2]))
  •  Tags:  
  • r
  • Related