代写 R html graph Plots

Plots
https:www.statmethods.netgraphsindex.html
Bar plot the Pens
Dot plot the Notebooks
Pie chart the Pens, Pencils, Notebooks and Erasers with the appropriate labels
R advanced

Load builtin dataset UCBAdmissions use function data
dataUCBAdmissions
Split the complex dataframe
Example: accepted UCBAdmissions1,,
Play with the 3 dimension array and split the data between
Males accepted in department A
Females accepted in department A
Females rejected in department E
Males and females accepted in department F
Compute the total percentage of males accepted per department and assign it to variable malesPerDepartment hint: the result is a vector of 6 positions, one per department
Compute the total percentage of males accepted in the university and assign it to variable malesAccepted hint: the result is a single number between 0 and 100
Compute the total percentage of females accepted per department and assign it to variable femalesPerDepartment hint: the result is a vector of 6 positions, one per department
Compute the total percentage of males accepted in the university and assign it to the variables femalesAccepted hint: the result is a single number between 0 and 100
Create a vector with the results of exercises 3 and 5 and assign it to the variables accepted
Barplot the vector accepted
Question 1: Can we extract any conclusion? Is there a deviation by sex? Reason your answer with data
Question 2: Is there any difference between the choice of department between females and males? Reason your answer
Compute the percentage of students females and males accepted per department and assign it to the variable acceptedPerDepartment hint: the result is a vector with 6 positions
Barplot the acceptedPerDepartment
Question 3: Which conclusion can you extract? Do you still think that there is a deviation by sex? Which other conclusion can we extract comparing the last plot? Reason your answer

R extra

For this exercise well use the builtin dataset state.x77
Make sure the object is a data frame, if not change it to a data frame.
Find out how many states have an income of less than 4300.
Find out which is the state with the highest income.
With the dataset swiss, create a data frame of only the rows 1, 2, 3, 10, 11, 12 and 13, and only the variables Examination, Education and Infant.Mortality.
The infant mortality of Sarine is wrong, it should be a NA, change it.
Create a row that will be the total sum of the column, name it Total.
Create a new variable that will be the proportion of Examination Examination Total
Create a data frame with the datasets state.abb, state.area, state.division, state.name, state.region. The row names should be the names of the states.
Rename the column names so only the first 3 letters after the full stop appear e.g. States.abb will be abb.
Add the previous data frame columnwise to state.x77
Remove the variable div.
Also remove the variables Life Exp, HS Grad, Frost, abb, and are.
Add a variable to the data frame which should categorize the level of illiteracy:
0,1 is low, 1,2 is some, 2, inf is high.
Find out which state from the west, with low illiteracy, has the highest income, and what that income is.