How can we access files from our own project in Rstudio?
I have already created a project with the ProjectID: project-Gv9GypjJ668yKJPqJFGgz9Q4:/ and Record /cohort ID: record-GvQ421jJ668y1xBFk55pJbJY. How do I read my data into Rstudio? Can anyone please kindly assist me?
Comments
1 comment
Hi Thanh,
In the RStudio Terminal, try
setwd("~/")
Then you can see the list of files and folders in the top level of your project by doing
system("dx ls")
Accessing standard files such as the files in the Bulk folder can be done in two ways: using dxFuse or using dx download. The dxFuse is read-only.
For more details, see this Intro to RStudio video, https://www.youtube.com/watch?v=d6uEl4U8NEM&list=PLRkZ0Fz-n3Z7Jg0Vz4vudLYnBza4EUGLM&index=13
Here are some screenshots from the video
Accessing the tabular data from the Parquet database is more complicated. One way is to extract the data you need into a csv file, and then read the csv file using dxFuse or dx download.
For an example of creating the csv file, see this forum thread https://community.ukbiobank.ac.uk/hc/en-gb/community/posts/19671290524317-How-to-extract-all-the-phenotypes-available-for-a-single-individual
There are some RStudio Notebooks in the UK Biobank Github repo that you might find useful, see https://github.com/UK-Biobank/UKB-RAP-Notebooks-Access
Please sign in to leave a comment.