Site icon Tutor Bin

CSUGC R Testing Custom functions in R Project

CSUGC R Testing Custom functions in R Project

Description

Build and Test Five (5) Custom Functions in R

R is a versatile programming language with so many powerful features. One of these features is the ability to define and then use R named pieces of R code called functions. Having a solid R programming skill is essential in data science. It allows us to manage data and perform data modeling and analysis.

In this assignment, you will use R and RStudio to create an R script (*.R) file to build and test five (5) custom functions in R. You will also provide a one-page summary of what you did, an interpretation of the results you obtained, and a reflection on your learning experience.

To prepare for this assignment:

Review the module’s interactive lecture and its references.

To complete this assignment:

Create an R Script (*.R) file to build and test five (5) custom functions in R according to the steps below. Test each function at least four (4) times.

As an example, the following function called addPercent() converts a value into a percentage with one decimal place:

  1. Give the script file a name that includes your first name and last name like this Solution-W6-FirstName-LastName.R:

Write a custom R function that inputs a temperature in Fahrenheit Fo and converts to Celsius Co. The relationship is Co = 5(Fo – 32)/9. Test the function at least four (4) times.

  1. Write a custom R function that computes the sum of squares of two numbers. Test the function at least four (4) times.
  2. Write a custom R that takes any univariate dataset and calculate the mean, minimum, maximum, and standard deviation.  Test the function at least four (4) times.

In statistics, often a dataset needs to be transformed to meet certain assumptions.  Write a custom R function that takes any univariate dataset and creates a boxplot of the raw dataset and a histogram of the square root transformed dataset. Test the function at least four (4) times.

  1. Write a custom R function of your own. Test the function at least four (4) times.
  2. Execute your *.R script file and display the results of its execution in the RStudio console and/or the Plots tabs.
  3. Take screenshots, showing current date and time, to demonstrate successful completion of your work. The screenshot should show the R commands you applied and the results you obtained. Do not capture trial and error results. Only your final results should be captured.
  4. Summarize your work in one page in which you explain what you did, interpret your results, and reflect on your experience:
  5. Explain how you completed this assignment and how you resolved the issues you faced, if any.
  6. Interpret the results you obtained from your actions including comments on the relationship between GDP and USEUR from the scatter plot and an examination of the goodness of fit of your linear regression model.

Reflect on your experience with this assignment and the lessons you learned.

  1. To submit your response to this assignment:
  2. Prepare all the required screenshots.

Prepare your summary of your work (what you did, interpretation of results, and reflection).

Submit one Word document that:

is at least 4-5 pages in length (including a cover page and a reference page, if any references are needed)

  1. Conforms to the CSU Global Guide to Writing and APA (Links to an external site.).

Includes a cover page with the module number and name of the Critical Thinking assignment.

  1. Does not include an abstract.

Includes all screenshots in the same order of execution of your *.R script.

  1. Includes a one-page summary of explanation of what you did, interpretation of results, and reflection. The one-page summary should follow the screenshot and should refer to them individually.

Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."

Exit mobile version