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,560 points
236 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
• 10,100 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,720 points
269 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,490 points
2,021 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
137 views
+5 votes
2 answers
+1 vote
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,560 points
162 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,680 points
211 views
+1 vote
2 answers
+1 vote
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
• 10,100 points
68 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
• 10,100 points
1,342 views