Skip to contents

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.

Usage

sin_data(n, p, f = 1)

Arguments

n

number of sample points to generate

p

sample dimensionality

f

jitter factor, default=1

Value

sample points in tibble format

Examples

sin_data(100, 4)
#> # A tibble: 100 × 4
#>         V1      V2      V3      V4
#>      <dbl>   <dbl>   <dbl>   <dbl>
#>  1  0.991   0.637  -0.825  -0.735 
#>  2  0.366   1.62    0.458   0.442 
#>  3 -0.458   1.53    0.639   0.596 
#>  4  1.20    0.623   0.461   0.444 
#>  5 -0.401  -1.33    0.155   0.154 
#>  6  0.479   0.0711  0.0975  0.0974
#>  7  0.587  -0.902  -0.315  -0.310 
#>  8  0.0660  0.483  -1.16   -0.916 
#>  9  0.918   0.976  -0.474  -0.457 
#> 10 -0.896  -0.818   1.01    0.844 
#> # ℹ 90 more rows
sin_data(100, 2, 200)
#> # A tibble: 100 × 2
#>         V1      V2
#>      <dbl>   <dbl>
#>  1 -0.185  -0.163 
#>  2  0.654   0.656 
#>  3  0.781   0.753 
#>  4  0.773   0.774 
#>  5 -0.724  -0.531 
#>  6  0.0262  0.0270
#>  7 -1.32   -0.780 
#>  8  0.380   0.441 
#>  9  1.50    1.23  
#> 10 -0.438  -0.361 
#> # ℹ 90 more rows