Learn R Programming

FREddyPro (version 1.0)

midpoints: Mid-point of a class

Description

Calculate the mid-point of a class produced by the cut() command

Usage

midpoints(x, dp = 2)

Arguments

x
The classes variable
dp
Integer giving the decimal digits of the output

Examples

Run this code
## Load the data
data(fluxes)

## Split the wind data into 20 classes
fluxes$wind_class<-cut(fluxes$wind_dir,breaks=seq(0,365,20))

## Find the midpoint of each wind class
fluxes$wind_mid_points<-midpoints(fluxes$wind_class)

Run the code above in your browser using DataLab