Open wtraylor opened 2 years ago
I suspect this is an issue with the file path "data/Duranunlak.EPD.lpd". After you've downloaded the file, try running it in interactive mode:
L = readLipd()
and then select the file. Let me know if this doesn't work. Also, note that this repository for lipdR is about to be deprecated, and the much newer, and soon-to-be-official version is at github.com/nickmckay/lipdR . However I don't think this is the issue here.
Thanks for looking into the issue so promptly.
I had tried the interactive mode. I am sure it has nothing to do with the file path.
Hmm,
Well it definitely seems like lipdR is having trouble finding the file. If you enter the full path to the file, like
L = readLipd("/Users/me/Downloads/Duranunlak.EPD.lpd")
Does that help? I tried to replicate this issue, but it's loading properly on my computer. If it's still not working for you I'll see if I can replicate on a Linux machine.
You are right! It has indeed something to do with the file path. I was too quick to discount that.
The behavior is rather strange. Here is what works and what doesn’t (assuming you have a copy of the file Duranunlak.EPD.lpd
both in the working directory and in a subdirectory data/
):
readLipd("Duranunlak.EPD.lpd")
readLipd(normalizePath("data/Duranunlak.EPD.lpd"))
readLipd() # select "s" and type: Duranunlak.EPD.lpd
readLipd() # select "d" and type: .
readLipd() # select "d" and type: data
readLipd() # select "d" and type: data/
readLipd() # select "d" and type: /home/<USER>/data/Duranunlak.EPD.lpd
readLipd("data/Duranunlak.EPD.lpd")
readLipd(file.path("data", "Duranunlak.EPD.lpd"))
readLipd() # select "s" and type: data/Duranunlak.EPD.lpd
readLipd("data")
There must be something wrong with the interpretation of relative file paths. The file in the subdirectory is found, as it is printed in the error message. Perhaps the issue could have something to do with the trailing \n
?
For me that’s good enough to work around the issue. If this repository is going to be superseeded by another package anyway, perhaps the issue can be closed.
Thanks for this, it's very helpful. It doesn't surprise me that relative file paths don't work quite right on linux, we haven't tested extensively on the platform. I'll keep this issue open and make a note to remember to look into this in the future.
In R, I am getting an error trying to read a specific LiPD file from the Temp12k collection.
It is this file: https://lipdverse.org/Temp12k/current_version/Duranunlak.EPD.lpd (MD5: 3bb741de65363c5f026d8a8e3ebad39c)
This is the error:
In Python, the file opens without an error message (with
lipd.readLipd()
), so I conclude that it’s not an error in the file itself, but in the R parser.Environment
This is the output of
sessionInfo()
: