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,560 points
62 views

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 \
    package-bar

answered Feb 6, 2019 by Sophie may
• 10,100 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
• 32,490 points
170 views
+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
• 32,490 points
462 views
+3 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, 2019 in Data Analytics by Cherukuri
• 32,490 points
43,269 views
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,770 points
24,847 views
+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,700 points
212 views
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
310 views
+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,100 points
78 views
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
223 views