Answered step by step
Verified Expert Solution
Question
1 Approved Answer
ASSIGNMENT 1 Write a code that contains the answers of the questions given below and save your file by using your name Name . R
ASSIGNMENT
Write a code that contains the answers of the questions given below and save your file by using your
name NameR Send me the R file.
Add a comment line that contains your name, surname, student ID and department
Calculate the remainder of the devision and the integer division according to your student ID Use the
last two digit of your student ID and th digit of your student ID
For instance, if your student ID is then calculate for divided by
If th digit is take that number as
For instance, if your student ID is then calculate for divided by
Assign the results to variables. For the former calculation, use your first name as the name of the
variable. For the latter calculation, use your surname as the name of the variable.
Create a vector that contains the names of your family members ie the first names of your parents,
siblings if there is no sibling write your name Use your SurnameName eg GonenSeza as the
name of the vector.
Create a code that returns the length of this vector.
Label the names of your family members by using an appropriate code.
Create a code that returns the name of your mother.
Create a vector that contains the digits of your student ID ie The name of
the vector should be NameID ie SezaID Add multiply by and take the square of each element
by using an appropriate code. Create a new vector for the new numbers. The name of the new vector
should be NewNameID eg NewSezaID For the NewNameID vector:
Find the maximum, minimum, and mean values.
Find the elements above mean values.
Find the elements below mean values.
By using command rep create a SurnameID vector ie GonenID The vector should be created
by repeating the numbers of your birthday eg The length of vector should be
Transform this vector to a matrix eg MGonenID The matrix should have rows and columns. The
numbers must be placed in rows first.
For instance, if your vector is:
The matrix:
Create a code that returns the division of the third row by second row.
Add this division as a new row to this matrix.
Calculate the sum of each row and add the results a new column.
Add appropriate names to each column and row.
Calculate the maximum, minimum, and mean values of nd column.
Create a matrix by using the vector you created in Question The first row of the matrix should be
that vector. The second row should be the ages of family members. The third row should be their gender.
Create a code that returns the dimension of this matrix.
Create a code that returns the Gender row.
Create a code that returns the Sibling column.
Add a grandparent column to the current matrix.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started