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.452   1.92  -0.652 -0.607
#>  2 -1.43   -0.465  0.810  0.725
#>  3 -0.0211 -1.75   0.721  0.660
#>  4  1.25   -0.503  0.802  0.719
#>  5 -0.320   0.351 -1.01  -0.848
#>  6 -0.806   2.09   1.02   0.851
#>  7  1.11   -0.144  0.525  0.501
#>  8 -0.710  -0.280  0.729  0.667
#>  9  0.207   0.430 -0.174 -0.173
#> 10 -0.599  -0.121  0.945  0.810
#> # ℹ 90 more rows
sin_data(100, 2, 200)
#> # A tibble: 100 × 2
#>         V1      V2
#>      <dbl>   <dbl>
#>  1  1.31    0.876 
#>  2  0.563   0.554 
#>  3 -2.74   -0.671 
#>  4  0.0701  0.0734
#>  5 -0.185  -0.117 
#>  6 -1.27   -1.01  
#>  7 -0.333  -0.271 
#>  8  0.591   0.547 
#>  9  1.54    0.855 
#> 10  0.0649  0.132 
#> # ℹ 90 more rows