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

0 votes

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 in Data Analytics by Tyrion anex
• 8,310 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 by Sophie may
• 9,870 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 in Data Analytics by Cherukuri
• 32,260 points
0 votes
2 answers

How to sort a data frame by columns in R?

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

answered Aug 21 in Data Analytics by anonymous
• 32,260 points
0 votes
2 answers

How to sum a variable by group in R?

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

answered Jul 31 in Data Analytics by Cherukuri
• 32,260 points
0 votes
1 answer

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

Yes, we can find the index of ...READ MORE

answered Apr 13, 2018 in Data Analytics by zombie
• 3,710 points
0 votes
7 answers
0 votes
4 answers

Python vs. R for data science

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

answered Aug 1 in Data Analytics by briny
0 votes
1 answer
0 votes
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
• 9,870 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 in Data Analytics by anonymous