I just noticed a very cool function in the caret-package, I would like to share.
The package can produce simulated data, which is very useful for Monte Carlo Simulations, or when you just want to try something out...
In addition, the psych-package has one of the best correlation tables.
The package can produce simulated data, which is very useful for Monte Carlo Simulations, or when you just want to try something out...
In addition, the psych-package has one of the best correlation tables.
library(caret)
## Loading required package: lattice
## Loading required package: ggplot2
set.seed(1)
df <- twoClassSim(5000, intercept = -13)
## Loading required package: MASS
summary(df)
## TwoFactor1 TwoFactor2 Linear01 Linear02
## Min. :-4.940 Min. :-5.017 Min. :-4.303 Min. :-3.683
## 1st Qu.:-0.956 1st Qu.:-0.969 1st Qu.:-0.696 1st Qu.:-0.668
## Median : 0.015 Median :-0.021 Median :-0.045 Median : 0.007
## Mean : 0.002 Mean :-0.010 Mean :-0.022 Mean : 0.014
## 3rd Qu.: 0.978 3rd Qu.: 0.974 3rd Qu.: 0.645 3rd Qu.: 0.669
## Max. : 5.076 Max. : 5.179 Max. : 3.728 Max. : 3.650
## Linear03 Linear04 Linear05 Linear06
## Min. :-3.217 Min. :-3.639 Min. :-3.825 Min. :-3.734
## 1st Qu.:-0.634 1st Qu.:-0.721 1st Qu.:-0.671 1st Qu.:-0.712
## Median : 0.053 Median :-0.003 Median : 0.012 Median : 0.009
## Mean : 0.026 Mean :-0.011 Mean : 0.014 Mean :-0.026
## 3rd Qu.: 0.677 3rd Qu.: 0.691 3rd Qu.: 0.674 3rd Qu.: 0.642
## Max. : 3.560 Max. : 3.651 Max. : 3.388 Max. : 3.810
## Linear07 Linear08 Linear09 Linear10
## Min. :-3.586 Min. :-3.637 Min. :-4.205 Min. :-3.733
## 1st Qu.:-0.677 1st Qu.:-0.714 1st Qu.:-0.694 1st Qu.:-0.648
## Median :-0.004 Median :-0.012 Median :-0.004 Median : 0.007
## Mean : 0.009 Mean :-0.016 Mean :-0.020 Mean : 0.000
## 3rd Qu.: 0.691 3rd Qu.: 0.688 3rd Qu.: 0.650 3rd Qu.: 0.668
## Max. : 3.485 Max. : 3.533 Max. : 3.414 Max. : 3.412
## Nonlinear1 Nonlinear2 Nonlinear3 Class
## Min. :-0.9979 Min. :0.0001 Min. :0.0002 Class1:4245
## 1st Qu.:-0.4917 1st Qu.:0.2453 1st Qu.:0.2516 Class2: 755
## Median : 0.0016 Median :0.5037 Median :0.4966
## Mean : 0.0037 Mean :0.4986 Mean :0.4987
## 3rd Qu.: 0.5101 3rd Qu.:0.7399 3rd Qu.:0.7426
## Max. : 0.9996 Max. :0.9999 Max. :0.9994
library(psych)
##
## Attaching package: 'psych'
##
## The following object is masked from 'package:ggplot2':
##
## %+%
pairs.panels(df)
Kommentare
Kommentar veröffentlichen