Closed xinyuejohn closed 7 months ago
Hi Xinyue,
Could you quickly confirm if you have the RICU_DATA_PATH
set? You can check by running Sys.getenv("RICU_DATA_PATH")
within your R session? If it returns ""
, you can set it with
Sys.getenv(RICU_DATA_PATH = "/path/to/where/you/want/your/ricu/datasets/to/live")
For me, the data path points to a folder in which each dataset has it's own subfolder (i.e., a mimic
folder, a miiv
folder, ...). I get the same error as you do if my path is not set. ricu
doesn't know where to look for your data. During import_src
, the fst files are generated in the same folder as the MIMIC IV source files but attach_src
does not know where that is. Unfortunately, attach_src
doesn't seem to throw an error in this case (@dplecko and @nbenn: probably worth considering throwing an error or a "X out of Y tables attached" kind of message?)
If you do not want to set an environment variable, you can pass the path to attach_src
. In your case, this should be
attach_src("miiv", data_dir = 'physionet.org/files/mimiciv/2.2')
Hope this helps!
Also, which version of ricu
are you using?
> packageVersion("ricu")
Also, which version of
ricu
are you using?> packageVersion("ricu")
I'm using 0.6.0.
@prockenschaub Thanks for your reply!
I tried to run attach_src("miiv", data_dir = 'physionet.org/files/mimiciv/2.2'), and it solved the issue. Thanks!
Thanks for your amazing work! I downloaded MIMIC-IV datasets from physionet myself. And then I was trying to import mimic4 dataset using ricu. Here are my steps: I used
import_src
to load the data andattach_src
to attach the source. However, when I tried to run the last linecohort <- load_concepts(static_features, "miiv", verbose = TRUE)
, I got an error:Could you help check if I missed some steps? Thanks!
Here's my code: