Hi,
I am trying to read the ddi data (acs 2024) file, but I am getting an error message, see below. Please advise
data ← read_ipums_micro(ddi)
Use of data from IPUMS USA is subject to conditions including that users should cite the data appropriately. Use command ipums_conditions() for more details.
Error: Cannot read file O:\Res. & Eval. Team@ R&E Data\IPUMS_extract\usa_00016.dat: Access is denied.
It looks like you are trying to use ipumsr to read in an IPUMS USA extract.
Assuming that you also specified the corresponding xml file as ddi previously in your R code (and that the xml file you specified has the same extract number as the data file you are trying to access), I don’t see any obvious issues in your code. I have asked my colleagues who maintain ipumsr to review and confirm there is no issue on our end. In the meantime, my best advice is to ensure that your ddi codebook (e.g., usa_00016.xml) and data file (e.g., usa_00016.dat.gz or usa_00016.dat – note that you do not NEED to decompress the file to read it into R) are stored in the same directory and that you are working out of that directory in your R session.
Two commands you could try to verify that the file exists at the expected path and that you have permission to read from it:
file.exists("O:/Res. & Eval. Team@ R&E Data/IPUMS_extract/usa_00016.dat")
readLines("O:/Res. & Eval. Team@ R&E Data/IPUMS_extract/usa_00016.dat", n = 10)
I did run the file.exists(), I got TRUE, however when I ran the readlines() commands I get “Error: Cannot read file” Access is denied