# ndays

From xts v0.12-0
by Joshua Ulrich

##### Number of Periods in Data

Calculate the number of specified periods in a given time series like data object.

- Keywords
- utilities

##### Usage

```
nseconds(x)
nminutes(x)
nhours(x)
ndays(x)
nweeks(x)
nmonths(x)
nquarters(x)
nyears(x)
```

##### Arguments

- x
A time-based object

##### Details

Essentially a wrapper to `endpoints`

with the appropriate
period specified; the resulting value derived from counting the
endpoints

As a compromise between simplicity and accuracy, the results will always round up to the nearest complete period. So n**** - 1 will return the completed periods.

For finer grain detail one should call a higher frequency n**** function.

An alternative summary can be found with `periodicity`

and `unclass(periodicity(x))`

.

##### Value

The number of observations for the period type specified

##### See Also

##### Examples

```
# NOT RUN {
getSymbols("QQQQ")
ndays(QQQQ)
nweeks(QQQQ)
# }
```

*Documentation reproduced from package xts, version 0.12-0, License: GPL (>= 2)*

### Community examples

Looks like there are no examples yet.