Question: Check the documentation on the mean ( ) function again: ? mean The Usage section of the documentation includes two versions of the mean (
Check the documentation on the mean function again:
mean
The Usage section of the documentation includes two versions of the mean function. The first usage,
meanx
is the most general usage of the mean function. The 'Default S method', however, is:
meanx trim narm FALSE,
The is called the ellipsis. It is a way for R to pass arguments along without the function having to name them explicitly. The ellipsis will be treated in more detail in future courses.
For the remainder of this exercise, just work with the second usage of the mean function. Notice that both trim and narm have default values. This makes them optional arguments.
Instructions
XP
Calculate the mean of the elementwise sum of linkedin and facebook and store the result in a variable avgsum.
Calculate the mean once more, but this time set the trim argument equal to and assign the result to avgsumtrimmed.
Print out both avgsum and avgsumtrimmed; can you spot the difference?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
