Posts

Showing posts from January, 2026

Module # 4 Programming structure assignment

Image
 The following data was collected by the local hospital. This data set contains 5 variables based on the observation of 10 patients. In addition to the measurements of the patients checking in to the hospital that night, this data provides the patients' histories regarding the frequency of their visits to the hospital in the last 12 months. This data displays the measurement of blood pressure, first assessment by a general doctor (bad=1, good =0) titled "first," the second assessment by an external doctor (called "second"), and the last row provides the head of the emergency unit's decision regarding immediate care for the patient based on the values 0 or 1 (low = 0, high =1). The names of your variables are as follows: "Freq","bloodp","first”, " second”, ”finaldecision” The rows  1.    "0.6","103","bad","low","low” 2.     "0.3","87","bad","low"...

Module # 2 Assignment

> # Create the vector > assignment2 <- c(16, 18, 14, 22, 27, 17, 19, 17, 17, 22, 20, 22) > # Original (incorrect) function > myMean <- function(assignment2) { + return(sum(assignment) / length(someData)) + } > # Test the original function (will give an error) > myMean(assignment2) Error in myMean(assignment2) : object 'assignment' not found > # Corrected function > myMean_corrected <- function(assignment2) { + return(sum(assignment2) / length(assignment2)) + } > # Test > myMean_corrected(assignment2) [1] 19.25      The original function fails because it uses variable names that are not defined inside the function. The corrected version succeeds because it consistently uses the function argument assignment2 to calculate the mean.

Module # 1: Assignment #1: Getting Started with R Programming Your first assignment

Image
In your blog, write a 2–3 paragraph report describing: Any issues you encountered during installation. How you resolved them (if applicable). Your system details (OS version, R version, RStudio version).      I installed R and RStudio a little over a year ago without any issues, and I am currently using version 2024.12.0 Build 467. I have  successfully   used RStudio in multiple previous classes and have not experienced any problems while using the software.      The PC I use for RStudio runs Windows 11 Home, version 24H2, and has a Ryzen 9 5900X CPU, a 4070ti Super GPU, and 32GB of DDR4 RAM. These specs have allowed RStudio to run smoothly and reliably for my coursework.      On your blog, post one paragraph summarizing: What an R vector is. Why vectors are fundamental to data analysis in R.      An R vector is the most basic data structure in R, representing an ordered collection of elements of the same data type, s...