[R] factors levels ?

2007-11-13 Thread W Eryk Wolski
Hi,

It's just some example code.. The application is uninteresting. I am
searching for some functionality.

X - rnorm(100) //my data

Y - seq(-3,3,by=0.1) // bin boundaries.

Now I would like to generate a - list of factors,  length as X...
i.e.: all values in the range [-3,-2.9) have the same factor... [-3,-2.9) etc.

I would assume R has such a function but I cant recall which one it is.


-- 
W. Eryk Wolski

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] factors levels ?

2007-11-13 Thread Eik Vettorazzi
cut(X,Y,right=F)

W Eryk Wolski schrieb:
 Hi,

 It's just some example code.. The application is uninteresting. I am
 searching for some functionality.

 X - rnorm(100) //my data

 Y - seq(-3,3,by=0.1) // bin boundaries.

 Now I would like to generate a - list of factors,  length as X...
 i.e.: all values in the range [-3,-2.9) have the same factor... [-3,-2.9) etc.

 I would assume R has such a function but I cant recall which one it is.


   

-- 
Eik Vettorazzi
Institut für Medizinische Biometrie und Epidemiologie
Universitätsklinikum Hamburg-Eppendorf

Martinistr. 52
20246 Hamburg

T ++49/40/42803-8243
F ++49/40/42803-7790

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] factors levels ?

2007-11-13 Thread Chuck Cleland
W Eryk Wolski wrote:
 Hi,
 
 It's just some example code.. The application is uninteresting. I am
 searching for some functionality.
 
 X - rnorm(100) //my data
 
 Y - seq(-3,3,by=0.1) // bin boundaries.
 
 Now I would like to generate a - list of factors,  length as X...
 i.e.: all values in the range [-3,-2.9) have the same factor... [-3,-2.9) etc.
 
 I would assume R has such a function but I cant recall which one it is.

?cut

-- 
Chuck Cleland, Ph.D.
NDRI, Inc.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 512-0171 (M, W, F)
fax: (917) 438-0894

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] factors levels ?

2007-11-13 Thread jombart
Hi,
see ?cut

?pretty can also help to define boundaries.

Regards,

Thibaut.

 Hi,

 It's just some example code.. The application is uninteresting. I am
 searching for some functionality.

 X - rnorm(100) //my data

 Y - seq(-3,3,by=0.1) // bin boundaries.

 Now I would like to generate a - list of factors,  length as X...
 i.e.: all values in the range [-3,-2.9) have the same factor... [-3,-2.9)
 etc.

 I would assume R has such a function but I cant recall which one it is.


 --
 W. Eryk Wolski

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.



__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] factors levels ?

2007-11-13 Thread W Eryk Wolski
Thanks...

Thats exactly what I was looking for..

Eryk

On Nov 13, 2007 2:38 PM, Eik Vettorazzi [EMAIL PROTECTED] wrote:
 cut(X,Y,right=F)

 W Eryk Wolski schrieb:

  Hi,
 
  It's just some example code.. The application is uninteresting. I am
  searching for some functionality.
 
  X - rnorm(100) //my data
 
  Y - seq(-3,3,by=0.1) // bin boundaries.
 
  Now I would like to generate a - list of factors,  length as X...
  i.e.: all values in the range [-3,-2.9) have the same factor... [-3,-2.9) 
  etc.
 
  I would assume R has such a function but I cant recall which one it is.
 
 
 

 --
 Eik Vettorazzi
 Institut für Medizinische Biometrie und Epidemiologie
 Universitätsklinikum Hamburg-Eppendorf

 Martinistr. 52
 20246 Hamburg

 T ++49/40/42803-8243
 F ++49/40/42803-7790





-- 
W. Eryk Wolski

www.eltango.co.uk
www.brementango.de

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] factors levels ?

2007-11-13 Thread Julian Burgos
What you are looking for is the findInterval() function.

Julian

W Eryk Wolski wrote:
 Hi,
 
 It's just some example code.. The application is uninteresting. I am
 searching for some functionality.
 
 X - rnorm(100) //my data
 
 Y - seq(-3,3,by=0.1) // bin boundaries.
 
 Now I would like to generate a - list of factors,  length as X...
 i.e.: all values in the range [-3,-2.9) have the same factor... [-3,-2.9) etc.
 
 I would assume R has such a function but I cant recall which one it is.
 


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.