44802/r-programming-linear-equation

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?

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

You can use the $ symbol to ...READ MORE

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

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

By using the loglm () function READ MORE

You can try something like this: # The ...READ MORE

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

Well it truly depends on your requirement, If ...READ MORE

You can do this in R using ...READ MORE

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

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

OR

At least 1 upper-case and 1 lower-case letter

Minimum 8 characters and Maximum 50 characters

Already have an account? Sign in.