Question

Can you give me the code for Question 12 through using R-programming? The Question instruction is Above question 9. Please help.

Functional programming For problems 9-12, you are shown a for loop. Write a function f which can be used with the indicated f

Problem 11 n <length(input) output--Inf for (i in :n) output <- max(f (input[i]) output) # replace with: output <-reduce(irpu

Comments
    0 0
    Add a comment Improve this question Transcribed image text
    Answer #1

    Problem 9 : To calculate range of 'input'

    f9 <- function(x){
    diff(range(x))
    }

    Problem 10 : to calculate the cumulative sum inn 'input'

    f10 <- function(x){
    cumsum(x)
    }

    Problem 11 : to calculate mode in 'input'

    f11 <- function(x){
    max((x-mean(x))/sd(x))
    }

    Add a comment
    Know the answer?
    Add Answer to:
    Can you give me the code for Question 12 through using R-programming? The Question instruction is...
    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
    • Original question is above, and is for C programming. As you will see in my code...

      Original question is above, and is for C programming. As you will see in my code below, I am not sure how to properly implement the functions I made for g(x) and h(x) (I call them g_x and h_x) into my function called trap. I know that in my main function in my function call to trap, I have to put something in the parentheses of g_x() and h_x() since they both take a type double argument, however I'm not...

    • Map, Filter, and Reduce are three functions commonly used in functional programming. For this assignment you...

      Map, Filter, and Reduce are three functions commonly used in functional programming. For this assignment you will be implementing all three, along with three minor functions that can be passed to them. Map The map function takes as arguments a function pointer and a integer vector pointer. It applies the function to every element in the vector, storing the results in-order in a new vector. It then returns a pointer to a new vector. You should pass your square function...

    • Please help me with the following C Programming project. I am providing the code I used...

      Please help me with the following C Programming project. I am providing the code I used which needs to be reworked to add the following requirements. Here is my code #include<stdio.h> char input; int main() { int i = 0; while (true){ scanf_s("%c", &input); if (input == 'X') break; printf("%c", input); } return 0; } Here are the requirements for the code plus and additional note what the code should have. Goals Understand the ASCII representation of character values. Understand...

    • Please Provide Code for above question , be sure that the C code compiles using GCC...

      Please Provide Code for above question , be sure that the C code compiles using GCC Task 6: Arrays: Statistics Calculations Write a C program which accepts a "large" mumber of real numbers and calculates their sample mean and sample variance. Revision: From statistics, the sample variance, ,of N samples, X1, X2,..XN, can be calculated as: N mcan(X) ) 2. (Xt (1) N-1 There are many algorithms for calculating a data set's variance. For this task you should implement the...

    • Programming language C Please go through this carefully. Needs function void add(int *a1, int n, int...

      Programming language C Please go through this carefully. Needs function void add(int *a1, int n, int *a2) Write a program addition.c that reads in an array (a1) of numbers, and creates a new array (a2) of numbers such that the first and last numbers of a1 are added and stored as the first number, the second and second-to-last numbers are added and stored as the second number, and so on. You need to check for even and odd length of...

    • C++ program: can you help create a autocorrect code using the cpp code provided and the...

      C++ program: can you help create a autocorrect code using the cpp code provided and the words below using pairs, vectors and unordered map: Objectives To practice using C++ std::pair, std::vector, and std::unordered_map To tie together what we've learned into the context of a real-world application used by millions of people every day Instructions For Full Credit You're given a short list of words in known_words_short.txt that contains a handful of very different words. Assume this short list of words...

    • I need help modifying this code please ASAP using C++ Here is what I missed on this code below Here are the instruction...

      I need help modifying this code please ASAP using C++ Here is what I missed on this code below Here are the instructions Here is the code Produce correct70 pts O pts Full Marks No Marks results and statisfy requirements view longer Comments 1. Your display amount is not readable 2. I withdraw more than my balance, but I didn't see any error message description Documentations10 pts 0 pts Full Marks No Marks : comment i code and block comment...

    • JAVA PROGRAMMING File Name You can not just take the file and send it. When Polycarp...

      JAVA PROGRAMMING File Name You can not just take the file and send it. When Polycarp trying to send a file in the social network "Codehorses", he encountered an unexpected problem. If the name of the file contains three or more "x" (lowercase Latin letters "x") in a row, the system considers that the file content does not correspond to the social network topic. In this case, the file is not sent and an error message is displayed. Determine the...

    • Programming project in Java: You are allowed to use the following methods from the Java API:...

      Programming project in Java: You are allowed to use the following methods from the Java API: class String length charAt class StringBuilder length charAt append toString class Character any method Create a class called HW2 that contains the following methods: 1. isAlphabeticalOrder takes a String as input and returns a boolean: The method returns true if all the letters of the input string are in alphabetical order, regardless of case. The method returns false otherwise. Do not use arrays to...

    • C++ Programming Question: This programming assignment is intended to demonstrate your knowledge of the following: ▪...

      C++ Programming Question: This programming assignment is intended to demonstrate your knowledge of the following: ▪ Writing a while loop ▪ Write functions and calling functions Text Processing [50 points] We would like to demonstrate our ability to control strings and use methods. There are times when a program has to search for and replace certain characters in a string with other characters. This program will look for an individual character, called the key character, inside a target string. It...

    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