2

Given these two objects:

v <- "new.name"

w <- 1:10

How can I tell R to rename w as new.name, so I can have this

  > new.name
 [1]  1  2  3  4  5  6  7  8  9 10

Thanks

Sergio.pv
  • 1,380
  • 4
  • 14
  • 23

1 Answers1

6

You could do

assign(v, w)
new.name
# [1]  1  2  3  4  5  6  7  8  9 10

But it is considered a very bad practice in R, so read this first

Community
  • 1
  • 1
David Arenburg
  • 91,361
  • 17
  • 137
  • 196