Skip to content
Prev 274867 / 398506 Next

cut data into sevral group and assign calculated values individually

Hm

Not much of an example.

You can cut your m according to breaks

cc <- cut(m, c(0,331,476, 608, 791, 900))
[1] (0,331]   (331,476] (476,608] (608,791] (791,900] <NA> 
Levels: (0,331] (331,476] (476,608] (608,791] (791,900]

You can add NA as an extra level by

factor(cc, exclude=NULL)
[1] (0,331]   (331,476] (476,608] (608,791] (791,900] <NA> 
Levels: (0,331] (331,476] (476,608] (608,791] (791,900] <NA>

but I wonder what you want to do with m_group then.

You shall explain in more detail what you want to do to get sensible 
answer.

Regards
Petr
it:
NA
http://www.R-project.org/posting-guide.html
http://www.R-project.org/posting-guide.html