Question: please answer hy giving the code for numbers 3 and 4. the program being used is r studio DATA TYPES and STRUCTURES 0. Download homework4.Rmd

please answer hy giving the code for numbers 3 and 4. the program being used is r studio please answer hy giving the code for numbers 3 and 4. the

DATA TYPES and STRUCTURES 0. Download homework4.Rmd notebook and employee.csv files from the course website your working directory. You will read employee.csv data later in Question 8. 1. Create a vector named country with the following 7 elements: USA, USA, USA, USA, France, Italy, Germany (Consider these values as the countries of 6 people) 2. Use class(country) to see the data type in this vector. What is the data type? 3. Create a logical vector citizen to indicate if the individual is a USA citizen based on the countries included in the vector country 4. Display the vector citizen to see if the entries are correct. (Hint: The first four entries must be TRUE, TRUE, TRUE, TRUE) 5. Use class(citizen) to see the data type in this vector. What is the data type? 6. Create a data frame (called df) containing two columns: country and citizen 7. Create a 2x3 matrix (call it mtr), enter the values as shown below, and display the matrix to see if the values are entered correctly. 12 13 128 READ DATA and DISPLAY (SELECT) SUBSET OF DATA 8. Read the dataset employee.csv in the workspace 9. Write the code to display the following rows/columns in the employee object (a) Data in the first 6 rows of 3 931 words Display Settings D.Focus 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!