Thanks to Jim Holtman. This is very usefull to improve my script.
Best, Muhammad Subianto
On this day 20/12/2005 17:19, jim holtman wrote:
>try this:
>
>set.seed(1)
># generate some test data
>x.1 <- data.frame(seg=sample(1:6,20,T), class=sample(c('good',
>'poor'),20,T))
>x.1
>(x.sp <- split(x.1,
try this:
set.seed(1)
# generate some test data
x.1 <- data.frame(seg=sample(1:6,20,T), class=sample(c('good',
'poor'),20,T))
x.1
(x.sp <- split(x.1, x.1$seg))
# test each segment for occurance of class.
lapply(x.sp, function(.seg){
if (all(.seg$class == 'good')) return('good')
if (all(.se
Dear R users,
I have a problem, which I can not find a solution.
Probably someone could help me?
I have a result from my classification, like this
> credit.toy
[[1]]
age married ownhouse income gender class
1 20-30 no nolow male good
2 40-50 no yes medium female