Reputation: 139
I am trying to load two rdata files, InvoiceDetail20210818A and InvoiceDetail20210818B. However, R imports the InvoiceDetail20210818A file into my environment and automatically names it InvoiceDetail20210818B, but when I open the file, it contains all the data for the "A" file. When I load the actual InvoiceDetail20210818B file, it correctly names it InvoiceDetail20210818B in the environment with the data from the "B" file. There are no errors when I load the files, and I have tried deleting the existing "A" rdata file, and creating a new rdata file, but I am still encountering this issue. Does anyone know why this would be?
Code:
load("~/InvoiceDetail20210818A.rdata")
What my environment looks like:
What the dataset looks like when I open it:
EDIT: Thank you to Panagiotis Togias in the comments, who said that "Saving an object in .RData format, saves also its assigned name. I would assume that before exporting to .RData, your file was loaded to env with the wrong name". I renamed the dataset as ending in "A", then re-saved it as an rdata file and now it is loading with the correct name.
Upvotes: 0
Views: 470