In order to receive full credit for the practice problems, you need to submit an R script file. All the non-R codes need to be placed after the # signs. You also need to write your name and Assignment 2 on top of the page. Please make sure to include your name as part of the file name.
To complete this assignment, you need to use what you’ve learned from this course. You might not receive credits if you use the functions that are not used in this course.
You can only ask questions for clarification purposes on the Discussion Board. That is to say, you can’t ask questions about how to answer a specific question or help you to debug your program.
You need to load Assignment2.RData to complete this assignment:
> load("Assignment2.RData")
> ls()
[1] "chol" "patient" "sbp"
You will use the data frame, sbp, for this problem.
> head(sbp)
id |
visit |
sbp |
1 125F |
1 |
122 |
2 13000M |
1 |
NA |
3 13120M |
1 |
116 |
4 13260M |
1 |
122 |
5 13480M |
1 |
NA |
6 13520M |
1 |
132 |
This dataset contains SBP (Systolic Blood Pressure) measurements for each patient. Some patients were measured once and some were measured more than once. The description of each variable is described below:
VARIABLE |
DESCRIPTION |
id |
Patient ID |
visit |
The visiting time |
sbp |
Systolic blood pressure |
The gender of each patient can be identified from the last field of the ID variable with ‘M’ for Male or ‘F’ for Female. The gender field can be in either upper or lower cases. Some of the IDs start with an ‘x’ and some don’t. For example, ‘x13260M’ and ‘13260M’ refers to the same person.
Write a function, getMaxSBP, that takes one argument, which is the name of the input data. The function returns a data frame that contains only one observation for each patient with the following variables:
newID : is created by using the numerical fields of the ID variable. For example, if ID is ‘x13260M’ or ‘13260M’, then NEWID is ‘13260’.
Sex : is created by using the last field of the ID variable, with values, equals ‘M’ or ‘F’ (all in upper cases).
maxsbp : is the maximum SBP for each patient. If an SBP is measured greater than 300, then the SBP value should be considered invalid. In this case, the SBP is considered as the missing value. Some patients might only contain one missing value for this variable.
maxvisit : is the visiting time that corresponds to the maximum SBP when the patient was measured. For example, consider the following scenarios:
If a patient was measured three times with
◦ SBP = 120 when visit = 1
◦ SBP = 142 when visit = 2
◦ SBP = 132 when visit = 3
then MAXSBP = 142 and MAXVISIT = 2
If a patient was measured three times with
◦ SBP = 120 when visit = 1
◦ SBP = 305 when visit = 2
◦ SBP = 132 when visit = 3
CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,
Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This
7COM1028 Secure Systems Programming Referral Coursework: Secure
Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip
CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme