Posts

Showing posts from January, 2026

Module #2 Assignment

Image
  In this assignment, I was given a set of numbers and named the vector assignment2. The original myMean function failed because the variable name inside the function (assignment and someData) do not match the argument assignment2. R looks for assignment is the function is called and it will calculate the sum of someData to determine the length but can't find neither variable so it gives an error. R only works when the function operates on a variable that is passed as an argument and defined within the function itself.  The corrected function in the second paragraph uses the argument assignment2 consistently in both sum() and length(). This allows R to run the total of the numbers in the vector and divide by how many numbers there are. It will return the correct mean of 19.25. Basically, the error happens due to inconsistent variable names, and fixing the name ensures the function works as intended. GitHub:  nbrown022/r-programming-assignments: Naomi Brown

Assignment #1: Getting Started with R Programming

Image
Any issues you encountered during installation? I already had R installed into my computer due to taking classes in the past where R was required for the class. I never uninstalled it since I was going to be taking more programming classes that required it. The version that I have was the version that professors tell us to install in the introduction class of R programming. But I did not have any issues installing it.  How you resolved them (if applicable)? I had not issue with it already on my computer. So, I didn't have to resolve anything. Your system details (OS version, R version, RStudio version)? I am not very sure which version I have. But I think I have the RStudio version through posit. When I did install R, I did go through posit website that was given by my professor at the time and that is how I installed the version that I have now What an R vector is? Why vectors are fundamental to data analysis in R? R vector is the most basic data structure in R that consists of c...