[R] Saving objects in RData file in different name

Christofer Bogaso bog@@o@chri@tofer @ending from gm@il@com
Sat Jul 28 13:34:36 CEST 2018


Hi,

Let say I have 2 objects as below

x1 = 1:3
x2 = 5:4

Now I want to save both x1 and x2 in some RData file, however x1 will be
saved with a different name e.g. y

I tried below

save(y = x1, x2, file = "file.RData")

However still they are saved in their original names i.e. x1 and x2, not y
and y2.

Is there any possibility that I can achieve above without explicitly
copying y = x1 before y is passed to save()

Thanks for any feedback.

	[[alternative HTML version deleted]]



More information about the R-help mailing list