[R] Loading aliased file in MacOSX

Marc Girondot m@rc_grt @end|ng |rom y@hoo@|r
Wed Sep 11 16:21:49 CEST 2019


If I try to load data from an alias file made using Cmd+Ctrl+A in finder 
for MacOSX, I get an error. Symbolic links are working well but 
sometimes, it is easier to use finder rather than terminal.

Has someone a solution to help R to read the original aliased file ?

Thanks

Here is a reproducible example:

A <- 10
save(A, file="A.Rdata")
rm(A)

# Make hard link
system(paste("ln A.Rdata B.Rdata"))
load(file="B.Rdata")
# It works
print(A)

rm(A)

# Make symbolic link
system(paste("ln -s A.Rdata C.Rdata"))
load(file="C.Rdata")
# It works
print(A)

rm(A)

# Make an alias of the A.Rdata file in finder using Cmd+Ctrl+A; the name 
of the new file is "A.Rdata alias"
load(file="A.Rdata alias")

It failed with this error:

Error in load(file = "A.Rdata alias") :
 ?? mauvais num??ro magique de restauration de fichier (le fichier est 
peut ??tre corrompu) -- aucune donn??e charg??e
De plus : Warning message:
 ?? file ???A.Rdata alias??? has magic number 'book'
Use of save versions prior to 2 is deprecated



More information about the R-help mailing list