From kmbell56 at gmail.com  Wed Feb  7 16:14:32 2018
From: kmbell56 at gmail.com (Kenny Bell)
Date: Wed, 07 Feb 2018 15:14:32 +0000
Subject: [Rd] saveRDS() overwrites file when object is not found
Message-ID: <CAPekMC=7FrMGEzm7G_9r7JRTdQd23UTPjb9q7Vkx0dPoW1LhjQ@mail.gmail.com>

I ran into this behaviour when accidentally running a line of code that I
shouldn't have.

When saving over an rds with an object that's not found, I would have
expected saveRDS to not touch the file.

saveRDS(iris, "test.rds")
file.size("test.rds")
#> [1] 1080
saveRDS(no_object_here, "test.rds")
#> Error in saveRDS(no_object_here, "test.rds"): object 'no_object_here'
not found
file.size("test.rds")
#> [1] 20
file.remove("test.rds")

	[[alternative HTML version deleted]]



[Rd] saveRDS() overwrites file when object is not found
Kenny Bell