Hi everyone.
I requested Return Data Field from UKBB, and they provided a TXT File.. They wrote that "Linkage has been undertaken such that IDs within the files correspond to IDs for your application". How do I combine that to my project? Thank you.
I suggest you upload the files to your RAP project storage, start a Jupyter Lab instance using either Python or R, read your project data cohort file into the JupyterLab instance, read the Return data files into the JL instance, and then join the datasets on the ID fields.
For example, if you are using R with the tidyverse package, you could do the join using
left_join(your_main_data, return_data_file_name, by = c("participant" = "eidNNNNN") )
(assuming that the participant ID field is called "participant" in your main file, and the ID field is called "eidNNNNN" in the .txt file).
To read a .txt file into R I think the fread() function would work.
If the .txt format is a problem in JupyterLab, you could convert the file before you upload it.
If you haven't already created a cohort with a selection of the fields you need , then it might be best to do that before you try to join the return data.
Comments
1 comment
I suggest you upload the files to your RAP project storage, start a Jupyter Lab instance using either Python or R, read your project data cohort file into the JupyterLab instance, read the Return data files into the JL instance, and then join the datasets on the ID fields.
For example, if you are using R with the tidyverse package, you could do the join using
left_join(your_main_data, return_data_file_name, by = c("participant" = "eidNNNNN") )
(assuming that the participant ID field is called "participant" in your main file, and the ID field is called "eidNNNNN" in the .txt file).
To read a .txt file into R I think the fread() function would work.
If the .txt format is a problem in JupyterLab, you could convert the file before you upload it.
If you haven't already created a cohort with a selection of the fields you need , then it might be best to do that before you try to join the return data.
Please sign in to leave a comment.