ITA 04 - Day3 - Assignment
ITA 04 - Day3 - Assignment
2. Create the following data frame, subsequently invert Gender for all individuals.
a) Name Age Height Weight Gender
Alex 25 177 57 M
Lilly 31 163 69 M
Mark 23 190 83 F
b) Create the below data frame
Name Working
Alex Yes
Lilly No
Mark No
c) Add the data frame column-wise to the previous one.
How many rows and columns does the new data frame have?
3. A student recorded his/her scores on weekly R programming quizzes that were marked out
of a possible 10 points. His/Herscores were as follows:
8, 5, 8, 5, 7, 6, 7, 7, 5, 7, 5, 5, 6, 6, 9, 8, 9, 7, 9, 9, 6, 8, 6, 6, 7
What is the mode of his/her scores on the weekly R programming quizzes?
a) Write appropriate R code and reshape the above data frame from wide data format
to long data format.
b) Write R code and reshape from long to wide data format.
5. Consider the following data present. Create this file using windows notepad . Save the file
as input.csv using the save As All files(*.*) option in notepad.
i. Use appropriate R commands to read input.csv file.
ii. Analyze the CSV File and compute the following.
a. Get the maximum salary
b. Get the details of the person with max salary
c. Get all the people working in IT department
d. Get the persons in IT department whose salary is greater than 600
e. Get the people who joined on or after 2014
iii. Get the people who joined on or after 2014 and write the output onto a file called
output.csv