Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(b) Suppose that the following table which gives data on ALL the players currently playing in the Superdiski has been captured as a dataframe
(b) Suppose that the following table which gives data on ALL the players currently playing in the Superdiski has been captured as a dataframe in R. Name Billiat Rikhotso Maduwa Team Chiefs Celtics Age Position 30 Midfielder 27 Defender Leopards 27 Goalie : Vilakazi de Goede Sundowns 31 Striker Stellenbosch 27 Midfielder The name of the R data frame is PD. Give an R command for (i) extracting all the data for the player in the 77th row of PD. (ii) extracting all the ages of the Superdiski players. [3 marks] [3 marks] (iii) extracting the age of the players in the 2nd, 5th and 11th position of the data frame PD. [4 marks] (iv) extracting data (all variables) for all midfielders. [3 marks] (v) extracting information (all variables) on all the goalkeepers who are below the age of 25. You must use bracketing []. [4 marks] (vi) extracting data (all variables) for all players who either strikers or midfielders. You must use the subset command. [4 marks] (vii) removing row 7,2,3 and 4 from PD. [4 marks]
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