Reputation: 5
I'm trying to load an .rdata file into R, but facing difficulty. The problem is with the original name of the .rdata file. It has the character '-' in it, which R reads as a minus sign, which means I cannot save the data and work with it. Code and error below.
load("/Users/hemingway1/Desktop/WVS3.rdata")
ls()
# [1] "a" "a1" "b"
# [4] "b1" "estBetaParams" "model"
# [7] "model_string" "mu" "n"
# [10] "samp" "theta" "var"
# [13] "WV3_Data_R_v_2015-04-18" "WVS3" "y"
WVS3 <- WV3_Data_R_v_2015-04-18
Error: object 'WV3_Data_R_v_2015' not found
Upvotes: 0
Views: 118
Reputation:
The use of backticks is generally the solution to solve this kind of problem. Here, the solution would be:
WVS3 <- `WV3_Data_R_v_2015-04-18`
Upvotes: 0