Posts

Showing posts from January, 2026

Module # 2 Assignment

I have downloaded and reviewed the import instructions.  Evaluate myMean Function:  Initial Code:  assignment2 <- c(16, 18, 14, 22, 27, 17, 19, 17, 17, 22, 20, 22) myMean <- function(assignment2) {   return(sum(assignment) / length(someData)) } myMean(assignment2) Output:  > myMean(assignment2) Error in myMean(assignment2) : object 'assignment' not found Corrected Code:  assignment2 <- c(16, 18, 14, 22, 27, 17, 19, 17, 17, 22, 20, 22) myMean <- function(assignment2) {   return(sum(assignment2) / length(assignment2)) } myMean(assignment2) Output:  > myMean(assignment2) [1] 19.25 >  Explanation:  The provided myMean function generated an error message indicating that an object was not found when I tested it in RStudio using the vector "assignment2". This happened because the code tried to use variable names (assignment and "someData") that weren't supplied as arguments or defined within the function. Because R function...

Assignment #1

Image
GitHub link:  https://github.com/rayhankhan-svg/r-programming-assignments R and RStudio:  I ran into a few little setup and system compatibility problems when installing R and RStudio. R was easy to install from CRAN, however at first I wasn't sure which version to obtain for my operating system. I verified the correct installer for my OS after carefully examining the CRAN download page, and I continued without any more issues. The installation of RStudio went quite smoothly as well, but in order for RStudio to properly identify R, I had to make sure R was fully installed first.  Another problem I ran into was that when I first launched RStudio, output did not appear in the Console right away. The Console started operating regularly after restarting RStudio and confirming that R was correctly installed and identified in the system path. Also I verified that both R and RStudio were running the most recent versions by looking up their versions in the Console. By paying...