print("Saving v to file saved_vector.Rdata")
v <- c(1,2,NA,4)
save(v, file="saved_vector.Rdata")

# dataframe:
mydf <- data.frame(
  attr1 <- c(1,2,3),
  attr2 <- c(4,5,6),
  attr3 <- c(7,8,9)
)
print("Saving df to file saved_dataframe.Rdata")
save(mydf, file="saved_dataframe.Rdata")

print("New contents of v:")
v <- c(-1234)
print(v)

print("New contents of mydf:")
mydf <- data.frame(c(-1234))
print(mydf)

print("Restoring v from file saved_vector.Rdata")
load("saved_vector.Rdata")

print("Restoring mydf from file saved_dataframe.Rdata")
load("saved_dataframe.Rdata")

print("Restored contents of v:")
print(v)

print("Restored contents of mydf:")
print(mydf)

