meanplot: The Mean Plot

Description Usage Arguments Examples

Description

meanplot() takes a vector of data, a list or a data frame x and finds the means for the different parts in the dataset. meanplot() is able to divide a vector of data into a self-chosen number of parts. The function meanplot() returns a plot of the means and the median of those. One more function is to find kind of a continous mean plot, where the first nr numbers of elements are evaluated and then continues through the whole dataset with steps 1.

Usage

1
meanplot(x, nr = 0, divide = TRUE, divided = TRUE, return = FALSE)

Arguments

x

The data to be analyzed. x needs to be a vector, a list or a data frame.

nr

If divide = TRUE: The total number of parts, the datasat has to be divided in, if x is a vector.\n If divide = FALSE: The number of elements which has to be evaluated at the same time while using the continous method.

divide

If set to FALSE, the continous method is used to find the means. Default set to TRUE.

divided

Needs to be defined to tell the function whether the dataset x is already divided into parts (list or data frame) or not divided into parts (vector). If divided is set to TRUE the function divides the dataset into nr parts which are "as equal as possible". Default set to TRUE.

return

If set to TRUE, the function meanplot() returns a vector of the estimated means. Default set to FALSE.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Simulate a dataset from a Poisson distribution:
x = rpois(1000, 3)
# Use meanplot() to divide x into 20 parts and to find the different means:
meanplot(x, divided = FALSE, nr = 20)
# Also return the estimated means:
meanplot(x, divided = FALSE, nr = 20, return = TRUE)

# Define a list (or data frame) of data:
x = list(c(1:4), c(4:10), c(1,6,1,8,0,0,98,6), c(10,11,11,11,11,6,3))
# Use meanplot() to find the means for the different parts:
meanplot(x)

AUMath-AdvancedR2018/StatEngPlots documentation built on May 23, 2019, 6:01 p.m.