Learn R Programming

mStats (version 3.4.0)

n_: Count from n_ to N_

Description

n_() generates the current observation number per specified group. It is regarded as grouped serial numbers.

N_() generates total number of observation per group. It is regarded as grouped total number.

Usage

n_(data, ...)

N_(data, ...)

Arguments

data

data.farme

...

variables for grouping

Value

data.frame

Details

If no variable is set in ..., all variables in the datset is used for grouping.

Examples

Run this code
# NOT RUN {
x <- n_(iris, Species)
# }
# NOT RUN {
x
codebook(x)

x <- N_(iris, Species)
x
codebook(x)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab