Execute a shell script that in turn runs a Python program followed by an R program

+1 vote

I've created a shell script that first runs a Python program to perform data pre-processing and then I'm trying to run an R program. I'm using Docker images for this:

FROM r-base:latest
FROM python
COPY . /usr/local/src/scripts
WORKDIR /usr/local/src/scripts
CMD ["./thisscript.sh"]

Inside thisscript.sh I've use the R CMD ... syntax for running my R script. But when I run the docker image, I get the following error:

./thisscript.sh: line 8: R: command not found

Any help?

Feb 6, 2019 in Data Analytics by Tyrion anex
• 8,670 points

1 answer to this question.

0 votes

You have two FROM commands in your Docker image. The FROM command is used to set the base image that your Dockerfile is created upon. You should always have only one of these. If you require additional tools that aren't in the base image, run commands that use platform-dependent package managers, like these:

RUN apt-get update && apt-get install -y \
    package-foo \

answered Feb 6, 2019 by Sophie may
• 10,550 points

Related Questions In Data Analytics

0 votes
1 answer

How do I remove an element from a list by index in R?

Use list[index] = NULL The list value will ...READ MORE

answered Oct 31, 2019 in Data Analytics by Cherukuri
• 33,010 points
+1 vote
2 answers

How to sort a data frame by columns in R?

You can use dplyr function arrange() like ...READ MORE

answered Aug 21, 2019 in Data Analytics by anonymous
• 33,010 points
+4 votes
3 answers

How to sum a variable by group in R?

You can also try this way, x_new = ...READ MORE

answered Jul 31, 2019 in Data Analytics by Cherukuri
• 33,010 points
0 votes
2 answers

R function for finding the index of an element in a vector?

The function match works on vectors : x <- sample(1:10) x # ...READ MORE

answered Dec 11, 2020 in Data Analytics by Rajiv
• 8,890 points
+10 votes
3 answers

Which is a better initiative to learn data science: Python or R?

Well it truly depends on your requirement, If ...READ MORE

answered Aug 8, 2018 in Data Analytics by Abhi
• 3,720 points
0 votes
7 answers
+1 vote
4 answers

Python vs. R for data science

I would say both Python and R ...READ MORE

answered Aug 1, 2019 in Data Analytics by briny
+1 vote
1 answer
+1 vote
1 answer

Can we have an if loop inside a for loop in R programming?

You're If loop doesn't have any condition ...READ MORE

answered Dec 21, 2018 in Data Analytics by Sophie may
• 10,550 points
0 votes
3 answers

Can a C program be written in R programming language?

If you have a algorithm you can ...READ MORE

answered Apr 9, 2019 in Data Analytics by anonymous