n-1 points are drawn from a normal distribution with mean=0, sd=1, the points in the final direction are calculated as the sine of the values of direction n-1 with additional jittering controled by the jitter factor f.

sinData(n, p, f = 1)

Arguments

n

sample dimensionality

p

number of sample points to generate

f

jitter factor, default=1

Value

sample points in tibble format

Examples

sinData(4, 100)
#> New names: #> * `` -> ...1 #> * `` -> ...2 #> * `` -> ...3 #> * `` -> ...4
#> # A tibble: 100 x 4 #> ...1 ...2 ...3 ...4 #> <dbl> <dbl> <dbl> <dbl> #> 1 0.701 -0.395 0.788 0.709 #> 2 0.856 0.824 -0.514 -0.492 #> 3 1.22 -0.769 0.557 0.529 #> 4 -0.746 0.178 -0.167 -0.166 #> 5 -0.454 -0.792 0.841 0.745 #> 6 -0.437 1.14 0.346 0.339 #> 7 -0.515 -0.0270 0.114 0.114 #> 8 0.626 -0.220 0.162 0.161 #> 9 -0.522 0.270 -0.0572 -0.0572 #> 10 -0.236 -1.57 -0.288 -0.284 #> # ... with 90 more rows
sinData(2, 100, 200)
#> New names: #> * `` -> ...1 #> * `` -> ...2
#> # A tibble: 100 x 2 #> ...1 ...2 #> <dbl> <dbl> #> 1 -0.178 -0.153 #> 2 1.18 0.917 #> 3 0.816 0.737 #> 4 -0.447 -0.454 #> 5 0.768 0.676 #> 6 -0.210 -0.217 #> 7 0.176 0.140 #> 8 -1.21 -0.948 #> 9 0.962 0.793 #> 10 -0.233 -0.258 #> # ... with 90 more rows