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,700 points
414 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,610 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,030 points
2,081 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
• 33,030 points
1,451 views
+4 votes
3 answers

How to sum a variable by group in R?

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

answered Aug 1, 2019 in Data Analytics by Cherukuri
• 33,030 points
77,378 views
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 12, 2020 in Data Analytics by Rajiv
• 8,910 points
56,040 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 9, 2018 in Data Analytics by Abhi
• 3,720 points
1,160 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
1,564 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,610 points
430 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
1,653 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP