R script in docker
1
0
Entering edit mode
3 months ago
mrashad ▴ 70

Hello,

I am new in docker and try to run this tutorial: https://www.r-bloggers.com/2019/02/running-your-r-script-in-docker/ Through this tutorial, I try to run R script insider the container through the visual studio code. In the first part of tutorial when using the docker file that run the R script manually by source the script from inside the container using:

source("02_code/myScript.R")

It opens the R in terminal inside the visual studio code and the R couldn't see the path of the data, so I tried to change the current working directory using setwd(), it gave me an error that the working directory cannot be changed. I tried to see what is my current directory, I found that it is "/" that I don't know if it is the root or anything else.

I went through the next steps in the tutorial and run the whole R script automatically, the same error appears to me and the path of the input data can't be identified.

Please find the attached photos, the code doesn't run except open the R 4.2 terminal

Your help is appreciated.

Regards

R Docker Visual-studio-code • 380 views
ADD COMMENT
3
Entering edit mode
3 months ago

This isn't a bioinformatics question. To access data that sits outside the container from within the container, you need to make it accessible within the container. See Docker's documentation on bind mounts.

ADD COMMENT
0
Entering edit mode

Thank you for your answer, it helps me to solve this error.

ADD REPLY

Login before adding your answer.

Traffic: 1148 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6