sample | R Documentation |

Takes a sample of the specified size from the elements of a
`"timeSeries"`

.

```
## S4 method for signature 'timeSeries'
sample(x, size, replace = FALSE, prob = NULL)
```

`x` |
an object from class |

`size` |
a non-negative integer giving the number of items to choose. |

`replace` |
sample with replacement if |

`prob` |
a vector of probability weights for obtaining the elements of the vector being sampled. |

The function takes a sample of size `size`

from the elements of
the time series with or without replacement depending on argument
`replace`

. The result is returned as a `"timeSeries"`

object.

For details about the arguments see the documentation of
`base:sample`

.

an object from class `"timeSeries"`

`sample`

(`sample`

in base **R**),

`sample`

(the `"timeDate"`

method)

```
## Monthly Calendar Series -
x <- daily2monthly(LPP2005REC[, 1:2])[3:14, ]
## Resample the Series with respect to the time stamps -
resampled <- sample(x)
resampled
is.unsorted(resampled)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.