Re: [R] split variable / create categories

2011-09-09 Thread David L Carlson
half Of Jean-Christophe BOUËTTÉ Sent: Friday, September 09, 2011 11:21 AM To: Martin Batholdy Cc: R Help Subject: Re: [R] split variable / create categories so what about : library(ggplot2) z <- breaks(x,equal=NULL,nbins=4) a <- cut(x,z,include.lowest = TRUE) it works for me ! JC 2011/9/9 Ma

Re: [R] split variable / create categories

2011-09-09 Thread David Winsemius
On Sep 9, 2011, at 12:10 PM, Martin Batholdy wrote: Thanks for the suggestions! However all these functions don't produce exactly what I want (at least with my actual data). I need a split-algorithm that converts the values of my vectors into four factors. And the crucial part is, that I n

Re: [R] split variable / create categories

2011-09-09 Thread Jean-Christophe BOUËTTÉ
so what about : library(ggplot2) z <- breaks(x,equal=NULL,nbins=4) a <- cut(x,z,include.lowest = TRUE) it works for me ! JC 2011/9/9 Martin Batholdy : > Thanks for the suggestions! > > However all these functions don't produce exactly what I want > (at least with my actual data). > > > I need a sp

Re: [R] split variable / create categories

2011-09-09 Thread Martin Batholdy
Thanks for the suggestions! However all these functions don't produce exactly what I want (at least with my actual data). I need a split-algorithm that converts the values of my vectors into four factors. And the crucial part is, that I need exactly the same number of elements in each factor-l

Re: [R] split variable / create categories

2011-09-09 Thread Jean-Christophe BOUËTTÉ
Hi there, library(lattice) equal.count(x,number=4,overlap=0) JC 2011/9/9 Martin Batholdy : > Hi, > > is there a function or an easy way to convert a variable with continuous > values into a categorial variable (with x levels)? > > here is what I mean: > > > I want to transform x: > > x <- c(3.2

Re: [R] split variable / create categories

2011-09-09 Thread Ben Tupper
Hi, On Sep 9, 2011, at 11:34 AM, Martin Batholdy wrote: > Hi, > > is there a function or an easy way to convert a variable with continuous > values into a categorial variable (with x levels)? > > here is what I mean: > > > I want to transform x: > > x <- c(3.2, 1.5, 6.8, 6.9, 8.5, 9.6,

[R] split variable / create categories

2011-09-09 Thread Martin Batholdy
Hi, is there a function or an easy way to convert a variable with continuous values into a categorial variable (with x levels)? here is what I mean: I want to transform x: x <- c(3.2, 1.5, 6.8, 6.9, 8.5, 9.6, 1.1, 0.6) into a 'categorial'-variable with four levels so that I get: [1]