R programming: Linear Equation

0 votes

Is it possible in R, to list a set of certain possible values for a given equation? For example:

Fora, b, and c with the formula a^3 + b^2 = c.

How can this be tested for all combinations of a and b such that a and b are less than 1000 and c to satisfy the formula and check if the variables are also valid inputs?

Apr 30, 2019 in Data Analytics by Tyrion anex
• 8,340 points
199 views

1 answer to this question.

0 votes

Use expand.grid to get all possible combinations and then subset the ones you require:

vals <- expand.grid(x=seq(1000), y=seq(1000))
subset(vals, a^3 + b^2 == 108)
#      a  b
# 8003 3  9
# 9002 2 10
answered Apr 30, 2019 by Sophie may
• 9,940 points

Related Questions In Data Analytics

0 votes
1 answer
0 votes
1 answer

Steps to evaluate Linear Regression in R

 These are sequential steps which need to ...READ MORE

answered Jul 25, 2018 in Data Analytics by CodingByHeart77
• 3,710 points
163 views
0 votes
2 answers

What are the rules to define a variable name in R programming language?

The same rules almost follow for all ...READ MORE

answered Aug 26, 2019 in Data Analytics by anonymous
• 32,440 points
188 views
0 votes
1 answer

How can I create log linear models in R language?

By using the loglm () function  READ MORE

answered Oct 10, 2018 in Data Analytics by zombie
• 3,750 points
46 views
+4 votes
2 answers
0 votes
1 answer

R programming: Linear programming problems

The documentation for the lp package provides ...READ MORE

answered Feb 4, 2019 in Data Analytics by Tyrion anex
• 8,340 points
95 views
+9 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 Anmol
• 3,680 points
109 views
+1 vote
2 answers
0 votes
1 answer

R Programming: matrices

Try this, It will test if a matrix ...READ MORE

answered Dec 17, 2018 in Data Analytics by Sophie may
• 9,940 points
46 views
0 votes
1 answer

R programming: Unexpected symbol error

Format your code this way: myfunction <- function() ...READ MORE

answered Dec 17, 2018 in Data Analytics by Sophie may
• 9,940 points
482 views