forked from BZPaper/RTransferEntropy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode_sample.Rd
More file actions
45 lines (39 loc) · 1.13 KB
/
code_sample.Rd
File metadata and controls
45 lines (39 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/code_sample.R
\name{code_sample}
\alias{code_sample}
\title{Codes the sample by assigning data to bins that are, for example, based on
the quantiles of the empirical distribution of the sample.}
\usage{
code_sample(x, type = "quantiles", quantiles = c(5, 95), bins = NULL,
limits = NULL, scale = 1e+10)
}
\arguments{
\item{x}{a vector of numerical values}
\item{type}{bins, limits or quantiles of empirical distribution to discretize
the data}
\item{quantiles}{quantiles to use for discretization}
\item{bins}{the number of bins with equal width used for discretization}
\item{limits}{limits used for discretization}
\item{scale}{a scale parameter}
}
\value{
returns a numerical vector
}
\description{
Codes the sample by assigning data to bins that are, for example, based on
the quantiles of the empirical distribution of the sample.
}
\examples{
\dontrun{
set.seed(42)
x <- rnorm(100)
code_sample(x)
# or coming from a data.table framework:
library(data.table)
set.seed(42)
dt <- data.table(x = rnorm(100))
dt[, sample := code_sample(dt$x)]
}
}
\keyword{internal}