Question

5. What would be the answer of the following R programming questions? What would be the answer of the following R code? a) X
0 0
Add a comment Improve this question Transcribed image text
Answer #1

The answer for question a is shown in terminal output

TAL Type demo() for some demos, help() for online help.o help.Start() for an HTML browser interface to help Type qotoThe part b code is

calculateEquation <- function(x,y) {

return(2*x+y^2)
}
res <- calculateEquation(-3,5)
print(res)

E Text Editor w Tab X Open G 1 calculateEquation <- function(x,y) { 2 3 return(2*x+y^2) s res <- calculateEquation) -3,5) 6 pThe output is 19

You can change the argument values and test

Add a comment
Know the answer?
Add Answer to:
5. What would be the answer of the following R programming questions? What would be the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • ) What would be the answer of the following R programming questions? What would be the...

    ) What would be the answer of the following R programming questions? What would be the answer of the following R code? x <- 1:4 y <- 6:9 z <- x + y    x? y? z? b)) Write a function in R Programming that returns 2x + y 2 for given x and y values. Then evaluate your function for x = −3 and y = 5.

  • IT Review    JAVASCRIPT (Can someone please help me answer the below questions. It would be nice...

    IT Review    JAVASCRIPT (Can someone please help me answer the below questions. It would be nice if you add comments explaining what you are doing? If unable to add comments the answer would be fantastic. Thank you. Given the following function definition: function percent(x) {      return x / 100; } Which of the following statements correctly calls the percent function: percent(10); percent: 10; percent(); percent = 10; Indicate whether each of the following evaluates to true or false, given...

  • Need help with these questions in C programming: 9. What is the output of the following...

    Need help with these questions in C programming: 9. What is the output of the following code? int X[10]={0}; int N=4; for(int k=0; k<N:k++) X[k] = k*2: printf("%d", X[N/2]; 10. Write a single statement to accomplish each of the following. Assume that each of these statements applies to the same program. a. Write a statement that opens file "oldmast.dat" for reading and assigns the returned file pointer to ofPtr. b. Write a statement that opens file "trans.dat" for writing and...

  • MATLAB Define the following computer programming terms and give an example of each. MATLAB example Sequence...

    MATLAB Define the following computer programming terms and give an example of each. MATLAB example Sequence Selection structure- Repetition structure - Relational operators (True = 1, False = 0) Logical operators (True = 1, False =0) And Or Less than Less than or equal to Greater than Greater than or equal to Equal to Not equal to Not ans ans Type the following relational operator commands into MATLAB in the command window one at a time. Write the results to...

  • C programming!!C programming!!C programming!!C programming!!C programming!! C programming!!C programming!!C programming!!C programming!!C programming!! C programming!!C programming!!C programming!!C...

    C programming!!C programming!!C programming!!C programming!!C programming!! C programming!!C programming!!C programming!!C programming!!C programming!! C programming!!C programming!!C programming!!C programming!!C programming!! Q2 (20 marks): remembering state, conditions, functions Write a function that takes two arguments an array and the size of the array and returns a count of all of the numbers between 2 and 5 inclusive. The code below shows how your function will be called. int main(void) { int values[6]={1,2,4,5,3,6}; int size=6; printf("There are %d values between 2 and 5 (inclusive)\n",...

  • Question 5 Answer the following questions What is the value of y when x is 15?...

    Question 5 Answer the following questions What is the value of y when x is 15? y-10 + 2x If y is 10 what value is x? y = 10 + 2x What is the value of y when x is 10 and z is 2? y = 10+2x-2c what is the value of y when x is 0? y = 10 + 2x-2z What is the value of y when x is -5? y 10-6x +5z r

  • (20pts) 1. For this problem, answer the following questions. (a) State the domain and range of...

    (20pts) 1. For this problem, answer the following questions. (a) State the domain and range of the following function f(x) = -55:<2 1, 2sr35 (i) Domain (ii) Range = (b) Evaluate (1)f(-3) = (ii) f(2)= (iii) (4) = (c) Given the followig augumented matrix write a system of equations it represents. Assume the variables are r. v. Do not solve. (d) What is the solution for the system of equations equivalent to the following reduces augmented matrix? Assume the variables...

  • Answer 5 and 6, using R programming code: 5. We have seen the following functions dnorm...

    Answer 5 and 6, using R programming code: 5. We have seen the following functions dnorm pnorm qnorm normal probability density function normal cumulative distribution function normal quantile function a. Let X have a normal distribution with mean 100 and variance 100. Find the 90th percentile of X by calling the function qnorm in two ways: (i) specify the arguments by position, and (ii) specify the arguments by complete names. b. Find P(X > 90) using the function pnorm in...

  • C Programming: Functions Please answer 1 and 2 on paper in C code. Not C++ or...

    C Programming: Functions Please answer 1 and 2 on paper in C code. Not C++ or C# just C. If you could provide some comments with a brief explanation of why you did what you did, that would be very much appreciated. Thank you for your help!! :) 1. Write a function that takes a single float, and returns that number rounded as an integer (not truncated, rounded properly). Ex: round(4.5) -> 5, round (4.4) -> 4 2. Write a...

  • Q2: Suppose that X-N(O, 1), U-N(O, 0.25), Y 3- 2X and Z following questions. 2 X...

    Q2: Suppose that X-N(O, 1), U-N(O, 0.25), Y 3- 2X and Z following questions. 2 X +U. Please answer the Compute E(Y), E(Z), Var(Y) and Var(Z). What are the distributions of Y and Z? Using R, draw 50 independent realizations of X and U. Using those values, create 50 realizations of Y and Z. (NOTE: set the seed for random number generation in R. Before your code type set.seed 123))

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT